summary refs log blame commit diff stats
path: root/tests/objects/tinherit_from_generic.nim
blob: 6e0e929ce0475d69c2ba6fe36764c3bb034f6a2f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
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'