Files
Nim/tests/objects/tinherit_from_generic.nim
Andreas Rumpf 3a13706d7d fixes #4673
2016-09-01 13:02:53 +02:00

14 lines
253 B
Nim

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'