tgenericconstraint.nim 197 B

123456789101112131415
  1. discard """
  2. errormsg: "cannot instantiate B"
  3. nimout: '''
  4. got: <typedesc[int]>
  5. but expected: <T: string or float>
  6. '''
  7. """
  8. type
  9. B[T: string|float] = object
  10. child: ref B[T]
  11. var b: B[int]