summary refs log tree commit diff stats
path: root/tests/generics/tsubclassgenericerror.nim
diff options
context:
space:
mode:
authorRay Imber <rayimber@gmail.com>2019-01-22 17:05:26 -0800
committerTimothee Cour <timothee.cour2@gmail.com>2019-01-22 17:05:26 -0800
commit94f6a6b29447caa1814016c61f9dd30b82d83eab (patch)
treeca89569e5488c9b283a7ce94d3f9aa7cec6434e6 /tests/generics/tsubclassgenericerror.nim
parenta0c07ef863ffe31cb7f71472d22cefa713edc61a (diff)
downloadNim-94f6a6b29447caa1814016c61f9dd30b82d83eab.tar.gz
Fix for issue #10342. better message for generic subclass instantiation (#10354)
* Fix for issue #10342. better message for generic subclass instantiation errors.
Diffstat (limited to 'tests/generics/tsubclassgenericerror.nim')
-rw-r--r--tests/generics/tsubclassgenericerror.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/generics/tsubclassgenericerror.nim b/tests/generics/tsubclassgenericerror.nim
new file mode 100644
index 000000000..87f8a8e64
--- /dev/null
+++ b/tests/generics/tsubclassgenericerror.nim
@@ -0,0 +1,11 @@
+discard """
+  errormsg: "cannot instantiate 'GenericParentType[T]' inside of type definition: 'GenericChildType'; Maybe generic arguments are missing?"
+  line: 8
+"""
+
+type
+  GenericParentType[T] = ref object of RootObj
+  GenericChildType[T] = ref object of GenericParentType # missing the [T]
+    val: T
+
+var instance : GenericChildType[int] = nil