t22753.nim 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. discard """
  2. cmd: "nim check --hints:off $file"
  3. errormsg: "type mismatch"
  4. nimoutFull: true
  5. nimout: '''
  6. t22753.nim(51, 13) Error: array expects two type parameters
  7. t22753.nim(52, 1) Error: expression 'x' has no type (or is ambiguous)
  8. t22753.nim(52, 1) Error: expression 'x' has no type (or is ambiguous)
  9. t22753.nim(52, 2) Error: type mismatch: got <>
  10. but expected one of:
  11. proc `[]=`(s: var string; i: BackwardsIndex; x: char)
  12. first type mismatch at position: 2
  13. required type for i: BackwardsIndex
  14. but expression '0' is of type: int literal(0)
  15. proc `[]=`[I: Ordinal; T, S](a: T; i: I; x: sink S)
  16. first type mismatch at position: 0
  17. proc `[]=`[Idx, T; U, V: Ordinal](a: var array[Idx, T]; x: HSlice[U, V];
  18. b: openArray[T])
  19. first type mismatch at position: 2
  20. required type for x: HSlice[[]=.U, []=.V]
  21. but expression '0' is of type: int literal(0)
  22. proc `[]=`[Idx, T](a: var array[Idx, T]; i: BackwardsIndex; x: T)
  23. first type mismatch at position: 2
  24. required type for i: BackwardsIndex
  25. but expression '0' is of type: int literal(0)
  26. proc `[]=`[T, U: Ordinal](s: var string; x: HSlice[T, U]; b: string)
  27. first type mismatch at position: 2
  28. required type for x: HSlice[[]=.T, []=.U]
  29. but expression '0' is of type: int literal(0)
  30. proc `[]=`[T; U, V: Ordinal](s: var seq[T]; x: HSlice[U, V]; b: openArray[T])
  31. first type mismatch at position: 2
  32. required type for x: HSlice[[]=.U, []=.V]
  33. but expression '0' is of type: int literal(0)
  34. proc `[]=`[T](s: var openArray[T]; i: BackwardsIndex; x: T)
  35. first type mismatch at position: 2
  36. required type for i: BackwardsIndex
  37. but expression '0' is of type: int literal(0)
  38. template `[]=`(a: WideCStringObj; idx: int; val: Utf16Char)
  39. first type mismatch at position: 3
  40. required type for val: Utf16Char
  41. but expression '9' is of type: int literal(9)
  42. template `[]=`(s: string; i: int; val: char)
  43. first type mismatch at position: 3
  44. required type for val: char
  45. but expression '9' is of type: int literal(9)
  46. expression: x[0] = 9
  47. '''
  48. """
  49. var x: array[3] # bug #22753
  50. x[0] = 9