From 905a22d137288bea8017dff42381b64fbe6387cb Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Fri, 24 Mar 2017 15:21:29 +0200 Subject: [PATCH] close #1128 --- tests/concepts/t1128.nim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/concepts/t1128.nim diff --git a/tests/concepts/t1128.nim b/tests/concepts/t1128.nim new file mode 100644 index 000000000..7f7525a13 --- /dev/null +++ b/tests/concepts/t1128.nim @@ -0,0 +1,21 @@ +discard """ + output: "true\ntrue" +""" + +type + TFooContainer[T] = object + + TContainer[T] = generic var c + foo(c, T) + +proc foo[T](c: var TFooContainer[T], val: T) = + discard + +proc bar(c: var TContainer) = + discard + +var fooContainer: TFooContainer[int] +echo fooContainer is TFooContainer # true. +echo fooContainer is TFooContainer[int] # true. +fooContainer.bar() +