mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
The magic `mArrGet`/`mArrPut` subscript overloads always match, so if a subscript doesn't match any other subscript overloads and isn't a regular language-handled subscript, it creates a fake overload mismatch error in `semArrGet` that doesn't have any information (gives stuff like "first mismatch at index: 0" for every single mismatch). Instead of generating the fake mismatches, we only generate the fake mismatch for `mArrGet`/`mArrPut`, and process every overload except them as a real call and get the errors from there.
12 lines
232 B
Nim
12 lines
232 B
Nim
discard """
|
|
matrix: "-d:testsConciseTypeMismatch"
|
|
nimout: '''
|
|
[1] proc `[]`[T; U, V: Ordinal](s: openArray[T]; x: HSlice[U, V]): seq[T]
|
|
'''
|
|
"""
|
|
|
|
type Foo = object
|
|
let x = Foo()
|
|
discard x[1] #[tt.Error
|
|
^ type mismatch]#
|