summary refs log tree commit diff stats
path: root/tests/errmsgs/tgenericconstraint.nim
blob: b7272e7878dd99ff3b5faefbca7f673715bbb827 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
discard """
  errormsg: "cannot instantiate B"
  line: 14
  nimout: '''
got: <typedesc[int]>
but expected: <T: string or float>
'''
"""

type
  B[T: string|float] = object
    child: ref B[T]

var b: B[int]