tdeclaredlocs.nim 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. discard """
  2. action: reject
  3. matrix: "--declaredLocs --hints:off"
  4. nimoutFull: true
  5. nimout: '''
  6. tdeclaredlocs.nim(92, 3) Error: type mismatch: got <seq[MyInt2]>
  7. but expected one of:
  8. proc fn(a: Bam) [proc declared in tdeclaredlocs.nim(86, 6)]
  9. first type mismatch at position: 1
  10. required type for a: Bam [object declared in tdeclaredlocs.nim(78, 3)]
  11. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  12. proc fn(a: Goo[MyInt2]) [proc declared in tdeclaredlocs.nim(89, 6)]
  13. first type mismatch at position: 1
  14. required type for a: Goo[MyInt2{char}] [object declared in tdeclaredlocs.nim(79, 3)]
  15. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  16. proc fn(a: Goo[cint]) [proc declared in tdeclaredlocs.nim(88, 6)]
  17. first type mismatch at position: 1
  18. required type for a: Goo[cint{int32}] [object declared in tdeclaredlocs.nim(79, 3)]
  19. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  20. proc fn(a: array[3, Bar]) [proc declared in tdeclaredlocs.nim(82, 6)]
  21. first type mismatch at position: 1
  22. required type for a: array[0..2, Bar] [object declared in tdeclaredlocs.nim(74, 3)]
  23. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  24. proc fn(a: seq[Bar]) [proc declared in tdeclaredlocs.nim(81, 6)]
  25. first type mismatch at position: 1
  26. required type for a: seq[Bar] [object declared in tdeclaredlocs.nim(74, 3)]
  27. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  28. proc fn(a: seq[MyInt1]) [proc declared in tdeclaredlocs.nim(80, 6)]
  29. first type mismatch at position: 1
  30. required type for a: seq[MyInt1{int}] [int declared in tdeclaredlocs.nim(72, 3)]
  31. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  32. proc fn(a: set[Baz]) [proc declared in tdeclaredlocs.nim(84, 6)]
  33. first type mismatch at position: 1
  34. required type for a: set[Baz{enum}] [enum declared in tdeclaredlocs.nim(75, 3)]
  35. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  36. proc fn(a: set[MyInt2]) [proc declared in tdeclaredlocs.nim(83, 6)]
  37. first type mismatch at position: 1
  38. required type for a: set[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  39. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  40. proc fn(a: var SetBaz) [proc declared in tdeclaredlocs.nim(85, 6)]
  41. first type mismatch at position: 1
  42. required type for a: var SetBaz [enum declared in tdeclaredlocs.nim(75, 3)]
  43. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  44. proc fn(a: var ref ptr Bam) [proc declared in tdeclaredlocs.nim(87, 6)]
  45. first type mismatch at position: 1
  46. required type for a: var ref ptr Bam [object declared in tdeclaredlocs.nim(78, 3)]
  47. but expression 'a' is of type: seq[MyInt2{char}] [char declared in tdeclaredlocs.nim(73, 3)]
  48. expression: fn(a)
  49. '''
  50. """
  51. #[
  52. see also: tests/errmsgs/tsigmatch.nim
  53. ]#
  54. # line 70
  55. type
  56. MyInt1 = int
  57. MyInt2 = char
  58. Bar = object
  59. Baz = enum k0, k1
  60. Baz2 = Baz
  61. SetBaz = set[Baz2]
  62. Bam = ref object
  63. Goo[T] = object
  64. proc fn(a: seq[MyInt1]) = discard
  65. proc fn(a: seq[Bar]) = discard
  66. proc fn(a: array[3, Bar]) = discard
  67. proc fn(a: set[MyInt2]) = discard
  68. proc fn(a: set[Baz]) = discard
  69. proc fn(a: var SetBaz) = discard
  70. proc fn(a: Bam) = discard
  71. proc fn(a: var ref ptr Bam) = discard
  72. proc fn(a: Goo[cint]) = discard
  73. proc fn(a: Goo[MyInt2]) = discard
  74. var a: seq[MyInt2]
  75. fn(a)