* Fix for issue #10342. better message for generic subclass instantiation errors.
This commit is contained in:
parent
a0c07ef863
commit
94f6a6b294
4 changed files with 33 additions and 4 deletions
11
tests/generics/tsubclassgenericerror.nim
Normal file
11
tests/generics/tsubclassgenericerror.nim
Normal 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
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
errormsg: "cannot instantiate: 'GenericNodeObj'"
|
||||
errormsg: "cannot instantiate: 'GenericNodeObj[T]'; Maybe generic arguments are missing?"
|
||||
line: 21
|
||||
"""
|
||||
# bug #2509
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue