-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missing ambiguity warning for Integer vs. Union{Int,Float64}? #16489
Comments
More specifically, we'd like to think of foo(x::Union{Int,ASCIIString}) = 7
foo(x::Union{Int,Float64}) = 8
foo(3) # ambiguous |
|
We couldn't find an update to the type ordering rules since the first Julia paper. If we followed the rules exactly as laid out there, the result is ambiguous because the intersection of In Section 2.10, p. 8, the only applicable rule for determining specificity is
The first three clauses are true when So, is there an updated specification of the type ordering? |
In Jeff's PhD thesis there is also a description of specificity here, but here none of rules are applicable to this case. |
Yes, there are extra rules regarding unions here: |
In a meeting with @stevengj, @ivirshup, and @janvitek, we were surprised that the following code did not yield an ambiguity warning:
The text was updated successfully, but these errors were encountered: