Nim/tests/concepts/t6462.nim
Zahary Karadjov 2ceee884fe fix #6462
2017-12-21 11:08:45 +01:00

23 lines
403 B
Nim

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