mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 20:14:44 +00:00
fixes #2509
This commit is contained in:
19
tests/objects/trefobjsyntax2.nim
Normal file
19
tests/objects/trefobjsyntax2.nim
Normal file
@@ -0,0 +1,19 @@
|
||||
# bug #2508
|
||||
|
||||
type
|
||||
GenericNodeObj[T] = ref object
|
||||
obj: T
|
||||
|
||||
Node* = ref object
|
||||
children*: seq[Node]
|
||||
parent*: Node
|
||||
|
||||
nodeObj*: GenericNodeObj[int]
|
||||
|
||||
proc newNode*(nodeObj: GenericNodeObj): Node =
|
||||
result = Node(nodeObj: nodeObj)
|
||||
newSeq(result.children, 10)
|
||||
|
||||
var genericObj = GenericNodeObj[int]()
|
||||
|
||||
var myNode = newNode(genericObj)
|
||||
Reference in New Issue
Block a user