Fix for issue #10342. better message for generic subclass instantiation (#10354)

* Fix for issue #10342. better message for generic subclass instantiation errors.
This commit is contained in:
Ray Imber 2019-01-22 17:05:26 -08:00 • committed by Timothee Cour
commit 94f6a6b294
4 changed files with 33 additions and 4 deletions

View file

@ -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

View file

@ -1,5 +1,5 @@
discard """
errormsg: "cannot instantiate: 'GenericNodeObj'"
errormsg: "cannot instantiate: 'GenericNodeObj[T]'; Maybe generic arguments are missing?"
line: 21
"""
# bug #2509