t15435.nim 611 B

123456789101112131415161718192021222324252627282930
  1. # bug #15435
  2. discard """
  3. errormsg: "type mismatch: got <set[uint8], set[range 1..5(uint8)]>"
  4. nimout: '''t15435.nim(28, 13) Error: type mismatch: got <set[uint8], set[range 1..5(uint8)]>
  5. but expected one of:
  6. proc `<`[T](x, y: set[T]): bool
  7. first type mismatch at position: 2
  8. required type for y: set[T]
  9. but expression 'x' is of type: set[range 1..5(uint8)]
  10. 20 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
  11. expression: {1'u8, 5} < x'''
  12. """
  13. ## line 20
  14. var
  15. x: set[range[1u8..5u8]]
  16. x.incl(1)
  17. x.incl(3)
  18. x.incl(5)
  19. if {1u8, 5} < x:
  20. echo "successful"