t10735.nim 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. discard """
  2. cmd: "nim check $file"
  3. errormsg: "illformed AST: case buf[pos]"
  4. nimout: '''
  5. t10735.nim(65, 5) Error: 'let' symbol requires an initialization
  6. t10735.nim(66, 10) Error: undeclared identifier: 'pos'
  7. t10735.nim(66, 10) Error: expression 'pos' has no type (or is ambiguous)
  8. t10735.nim(66, 10) Error: expression 'pos' has no type (or is ambiguous)
  9. t10735.nim(66, 9) Error: type mismatch: got <cstring, >
  10. but expected one of:
  11. proc `[]`(s: string; i: BackwardsIndex): char
  12. first type mismatch at position: 1
  13. required type for s: string
  14. but expression 'buf' is of type: cstring
  15. proc `[]`(s: var string; i: BackwardsIndex): var char
  16. first type mismatch at position: 1
  17. required type for s: var string
  18. but expression 'buf' is of type: cstring
  19. proc `[]`[I: Ordinal; T](a: T; i: I): T
  20. first type mismatch at position: 0
  21. proc `[]`[Idx, T; U, V: Ordinal](a: array[Idx, T]; x: HSlice[U, V]): seq[T]
  22. first type mismatch at position: 1
  23. required type for a: array[Idx, T]
  24. but expression 'buf' is of type: cstring
  25. proc `[]`[Idx, T](a: array[Idx, T]; i: BackwardsIndex): T
  26. first type mismatch at position: 1
  27. required type for a: array[Idx, T]
  28. but expression 'buf' is of type: cstring
  29. proc `[]`[Idx, T](a: var array[Idx, T]; i: BackwardsIndex): var T
  30. first type mismatch at position: 1
  31. required type for a: var array[Idx, T]
  32. but expression 'buf' is of type: cstring
  33. proc `[]`[T, U: Ordinal](s: string; x: HSlice[T, U]): string
  34. first type mismatch at position: 1
  35. required type for s: string
  36. but expression 'buf' is of type: cstring
  37. proc `[]`[T; U, V: Ordinal](s: openArray[T]; x: HSlice[U, V]): seq[T]
  38. first type mismatch at position: 1
  39. required type for s: openArray[T]
  40. but expression 'buf' is of type: cstring
  41. proc `[]`[T](s: openArray[T]; i: BackwardsIndex): T
  42. first type mismatch at position: 1
  43. required type for s: openArray[T]
  44. but expression 'buf' is of type: cstring
  45. proc `[]`[T](s: var openArray[T]; i: BackwardsIndex): var T
  46. first type mismatch at position: 1
  47. required type for s: var openArray[T]
  48. but expression 'buf' is of type: cstring
  49. template `[]`(a: WideCStringObj; idx: int): Utf16Char
  50. first type mismatch at position: 1
  51. required type for a: WideCStringObj
  52. but expression 'buf' is of type: cstring
  53. template `[]`(s: string; i: int): char
  54. first type mismatch at position: 1
  55. required type for s: string
  56. but expression 'buf' is of type: cstring
  57. expression: buf[pos]
  58. t10735.nim(66, 9) Error: expression '' has no type (or is ambiguous)
  59. t10735.nim(68, 3) Error: illformed AST: case buf[pos]
  60. '''
  61. joinable: false
  62. """
  63. let buf: cstring
  64. case buf[pos]
  65. else:
  66. case buf[pos]