You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a =1||"foo"
a +2# instantiating '(Int32 | String)#+(Int32)': ambiguous call matches both Int8 and Int16
It's odd that this mentions Int8 and Int16 which are not even used explicitly in this example. I guess it's because when the literal type is expanded it first notices that these could be ambiguous. It should definitely not compile because String#+ doesn't accept any integer, but the error message is wrong.
Even if the integer literals are typed explicitly, the error is similar:
a =1_i32||"foo"
a +2_i32# instantiating '(Int32 | String)#+(Int32)': ambiguous call matches both Int8 and Int16
The expected error should be something like no overload matches '(Int32 | String)#+' with type Int32.
The following code errors:
It's odd that this mentions
Int8
andInt16
which are not even used explicitly in this example. I guess it's because when the literal type is expanded it first notices that these could be ambiguous. It should definitely not compile becauseString#+
doesn't accept any integer, but the error message is wrong.Even if the integer literals are typed explicitly, the error is similar:
The expected error should be something like
no overload matches '(Int32 | String)#+' with type Int32
.Extracted from #6593
Introduced by #6074
The text was updated successfully, but these errors were encountered: