summary refs log tree commit diff stats
path: root/tests/concepts/t6462.nim
blob: 2fa2268f8307775a1f92193e429c36b1e109a248 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
discard """
  output: "true"
"""

import future

type
  FilterMixin*[T] = ref object
    test*:      (T) -> bool
    trans*:     (T) -> T

  SeqGen*[T] = ref object
    fil*:     FilterMixin[T]
  
  WithFilter[T] = concept a
    a.fil is FilterMixin[T]

proc test*[T](a: WithFilter[T]): (T) -> bool =
  a.fil.test

var s = SeqGen[int](fil: FilterMixin[int](test: nil, trans: nil))
echo s.test() == nil