diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/objects/tinherit_from_generic.nim | 13 |
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' |