t20922.nim 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. discard """
  2. cmd: "nim check $options --verbosity:0 --hints:off $file"
  3. action: "reject"
  4. nimout: '''
  5. t20922.nim(26, 5) Error: expression expected, but found ':'
  6. t20922.nim(34, 7) Error: expression expected, but found ':'
  7. t20922.nim(35, 5) Error: ':' or '=' expected, but got 'keyword of'
  8. Error: in expression ' '+'': identifier expected, but found ''
  9. t20922.nim(26, 7) Error: attempting to call undeclared routine: '<Error>'
  10. Error: in expression ' '+'': identifier expected, but found ''
  11. t20922.nim(26, 7) Error: attempting to call undeclared routine: '<Error>'
  12. t20922.nim(26, 7) Error: expression '' cannot be called
  13. t20922.nim(26, 7) Error: expression '' has no type (or is ambiguous)
  14. t20922.nim(26, 7) Error: VM problem: dest register is not set
  15. '''
  16. """
  17. # original test case issue #20922
  18. type Token = enum
  19. incDataPtr,
  20. incDataPtrByte
  21. proc mapInstrToToken(instr: char): Token =
  22. case instr:
  23. of '>':
  24. incDataPtr
  25. of: '+':
  26. incDataPtrByte
  27. # same issue with `of` in object branches (different parser procs calling `exprList`)
  28. type
  29. Bar = enum A, B
  30. Foo = object
  31. case kind: Bar
  32. of: x: int
  33. of B: y: float