summary refs log tree commit diff stats
path: root/tests/objects/trefobjsyntax3.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/objects/trefobjsyntax3.nim')
-rw-r--r--tests/objects/trefobjsyntax3.nim28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/objects/trefobjsyntax3.nim b/tests/objects/trefobjsyntax3.nim
new file mode 100644
index 000000000..2d466eeda
--- /dev/null
+++ b/tests/objects/trefobjsyntax3.nim
@@ -0,0 +1,28 @@
+# bug #2540
+
+type
+  BaseSceneNode[T] = ref object of RootObj
+    children*: seq[BaseSceneNode[T]]
+    parent*: BaseSceneNode[T]
+
+  SceneNode[T] = ref object of BaseSceneNode[T]
+
+  SomeObj = ref object
+
+proc newSceneNode[T](): SceneNode[T] =
+  new result
+  result.children = @[]
+
+var aNode = newSceneNode[SomeObj]()
+
+
+# bug #3038
+
+type
+  Data[T] = ref object of RootObj
+    data: T
+  Type = ref object of RootObj
+  SubType[T] = ref object of Type
+    data: Data[T]
+  SubSubType = ref object of SubType
+  SubSubSubType = ref object of SubSubType