tincompletecaseobject2.nim 757 B

123456789101112131415161718192021222324252627
  1. discard """
  2. cmd: "nim check $file"
  3. """
  4. type
  5. ABCD = enum A, B, C, D
  6. AliasABCD = ABCD
  7. RangeABC = range[A .. C]
  8. AliasRangeABC = RangeABC
  9. PrintableChars = range[' ' .. '~']
  10. case PrintableChars 'x': #[tt.Error
  11. ^ not all cases are covered; missing: {' ', '!', '\"', '#', '$$', '%', '&', '\'', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~'}]#
  12. of '0'..'9', 'A'..'Z', 'a'..'z': discard
  13. of '(', ')': discard
  14. case AliasABCD A: #[tt.Error
  15. ^ not all cases are covered; missing: {B, C, D}]#
  16. of A: discard
  17. case RangeABC A: #[tt.Error
  18. ^ not all cases are covered; missing: {A, C}]#
  19. of B: discard
  20. case AliasRangeABC A: #[tt.Error
  21. ^ not all cases are covered; missing: {A, B}]#
  22. of C: discard