This commit is contained in:
Zahary Karadjov
2017-06-19 22:07:54 +03:00
committed by Andreas Rumpf
parent 16eb4b1fee
commit a6006e56a7
5 changed files with 51 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
discard """
errormsg: "cannot instantiate B"
line: 20
nimout: '''
got: (type string)
but expected: (T: A)
'''
"""
type
A = concept c
advance(c)
B[T: A] = object
child: ref B[T]
proc advance(x: int): int = x + 1
var a: B[int]
var b: B[string]

View 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]