parent
1161482ec2
commit
b40ab4dc9e
3 changed files with 34 additions and 4 deletions
27
tests/compile/tinheritref.nim
Normal file
27
tests/compile/tinheritref.nim
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
discard """
|
||||
output: "23"
|
||||
"""
|
||||
|
||||
# bug #554, #179
|
||||
|
||||
type T[E] =
|
||||
ref object
|
||||
elem: E
|
||||
|
||||
var ob: T[int]
|
||||
|
||||
ob = T[int](elem: 23)
|
||||
echo ob.elem
|
||||
|
||||
type
|
||||
TTreeIteratorA* = ref object {.inheritable.}
|
||||
|
||||
TKeysIteratorA* = ref object of TTreeIteratorA #compiles
|
||||
|
||||
TTreeIterator* [T,D] = ref object {.inheritable.}
|
||||
|
||||
TKeysIterator* [T,D] = ref object of TTreeIterator[T,D] #this not
|
||||
|
||||
var
|
||||
it: TKeysIterator[int, string] = nil
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue