-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show symchoices as ambiguous in overload type mismatches
fixes #23397
- Loading branch information
Showing
9 changed files
with
97 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# bug #8066 | ||
|
||
when true: | ||
type | ||
MyEnum {.pure.} = enum | ||
valueA, valueB, valueC, valueD, amb | ||
|
||
OtherEnum {.pure.} = enum | ||
valueX, valueY, valueZ, amb | ||
|
||
|
||
echo valueA # MyEnum.valueA | ||
echo MyEnum.amb # OK. | ||
echo amb #[tt.Error | ||
^ type mismatch: got <MyEnum | OtherEnum> | ||
but expected one of: | ||
proc echo(x: varargs[typed, `$$`]) | ||
first type mismatch at position: 1 | ||
required type for x: varargs[typed] | ||
but expression 'amb' is of type: None | ||
ambiguous identifier: 'amb' -- use one of the following: | ||
MyEnum.amb: MyEnum | ||
OtherEnum.amb: OtherEnum | ||
expression: echo amb]# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const test* = "foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import mambparam1 | ||
export test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const test* = "bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
discard """ | ||
matrix: "-d:testsConciseTypeMismatch" | ||
""" | ||
|
||
import mambparam2, mambparam3 | ||
|
||
echo test #[tt.Error | ||
^ type mismatch | ||
Expression: echo test | ||
[1] test: string | string | ||
Expected one of (first mismatch at [position]): | ||
[1] proc echo(x: varargs[typed, `$$`]) | ||
ambiguous identifier: 'test' -- use one of the following: | ||
mambparam1.test: string | ||
mambparam3.test: string]# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import mambparam2, mambparam3 | ||
|
||
echo test #[tt.Error | ||
^ type mismatch: got <string | string> | ||
but expected one of: | ||
proc echo(x: varargs[typed, `$$`]) | ||
first type mismatch at position: 1 | ||
required type for x: varargs[typed] | ||
but expression 'test' is of type: None | ||
ambiguous identifier: 'test' -- use one of the following: | ||
mambparam1.test: string | ||
mambparam3.test: string | ||
expression: echo test]# |