summary refs log tree commit diff stats
path: root/tests/concepts/t1128.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2017-03-24 15:21:29 +0200
committerZahary Karadjov <zahary@gmail.com>2017-03-24 17:07:30 +0200
commit905a22d137288bea8017dff42381b64fbe6387cb (patch)
treea455270f2ff76b283e72d4489db767b0010f0db8 /tests/concepts/t1128.nim
parent79881bfce0970098b6dc38f6fbb18a86b54c7fad (diff)
downloadNim-905a22d137288bea8017dff42381b64fbe6387cb.tar.gz
close #1128
Diffstat (limited to 'tests/concepts/t1128.nim')
-rw-r--r--tests/concepts/t1128.nim21
1 files changed, 21 insertions, 0 deletions
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()
+