Fix #4737
This commit is contained in:
parent
16eb4b1fee
commit
a6006e56a7
5 changed files with 51 additions and 5 deletions
15
tests/errmsgs/tgenericconstraint.nim
Normal file
15
tests/errmsgs/tgenericconstraint.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
discard """
|
||||
errormsg: "cannot instantiate B"
|
||||
line: 14
|
||||
nimout: '''
|
||||
got: (type int)
|
||||
but expected: (T: string or float)
|
||||
'''
|
||||
"""
|
||||
|
||||
type
|
||||
B[T: string|float] = object
|
||||
child: ref B[T]
|
||||
|
||||
var b: B[int]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue