summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-09-01 13:01:22 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-09-01 13:02:53 +0200
commit3a13706d7d88527dca8140bcc71a5560ba146d31 (patch)
tree51c231b5b93685f5cad759924269e4d19b8061bc /tests
parentf6a2ff731b8d7288542d8dff93937c68d721edd1 (diff)
downloadNim-3a13706d7d88527dca8140bcc71a5560ba146d31.tar.gz
fixes #4673
Diffstat (limited to 'tests')
-rw-r--r--tests/objects/tinherit_from_generic.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/objects/tinherit_from_generic.nim b/tests/objects/tinherit_from_generic.nim
new file mode 100644
index 000000000..6e0e929ce
--- /dev/null
+++ b/tests/objects/tinherit_from_generic.nim
@@ -0,0 +1,13 @@
+discard """
+  output: '''true'''
+"""
+
+# bug #4673
+type
+  BaseObj[T] = ref object of RootObj
+  SomeObj = ref object of BaseObj[int]
+
+proc doSomething[T](o: BaseObj[T]) =
+  echo "true"
+var o = new(SomeObj)
+o.doSomething() # Error: cannot instantiate: 'T'