summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/generics/tgeneric_inheritance.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/generics/tgeneric_inheritance.nim b/tests/generics/tgeneric_inheritance.nim
new file mode 100644
index 000000000..66b5a6c69
--- /dev/null
+++ b/tests/generics/tgeneric_inheritance.nim
@@ -0,0 +1,19 @@
+discard """
+  output: '0.0'
+"""
+
+# bug #1919
+
+type
+  Base[M] = object of RootObj
+    a : M
+
+  Sub1[M] = object of Base[M]
+    b : int
+
+  Sub2[M] = object of Sub1[M]
+    c : int
+
+var x: Sub2[float]
+
+echo x.a