From 2ceee884fe4d87e1540bf1b1dbfbf2e4d661c7b2 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Fri, 6 Oct 2017 16:36:26 +0300 Subject: fix #6462 --- tests/concepts/t6462.nim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/concepts/t6462.nim (limited to 'tests/concepts') diff --git a/tests/concepts/t6462.nim b/tests/concepts/t6462.nim new file mode 100644 index 000000000..2fa2268f8 --- /dev/null +++ b/tests/concepts/t6462.nim @@ -0,0 +1,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 + -- cgit 1.4.1-2-gfad0