diff options
author | Zahary Karadjov <zahary@gmail.com> | 2017-10-06 16:36:26 +0300 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-12-21 11:08:45 +0100 |
commit | 2ceee884fe4d87e1540bf1b1dbfbf2e4d661c7b2 (patch) | |
tree | c08e1f6c313d0a297ec317b3908390c6eca4b857 /tests/concepts | |
parent | 057d5789ba6cf7e1f0cef681ffba77b0c4788110 (diff) | |
download | Nim-2ceee884fe4d87e1540bf1b1dbfbf2e4d661c7b2.tar.gz |
fix #6462
Diffstat (limited to 'tests/concepts')
-rw-r--r-- | tests/concepts/t6462.nim | 23 |
1 files changed, 23 insertions, 0 deletions
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 + |