tgenericconstraint.nim 203 B

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