-
-
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
Error message does not indicate conflicting type parameters #42401
Comments
@tyleringebrand you may want to make the title more informative, e.g. "Error message does not indicate conflicting type parameters" (I would change it myself but I don't have sufficient permission) |
@tyleringebrand , it would also be nice to test this with version 1.7 to make sure it hasn't been fixed already. |
To perhaps make it more clear why this is confusing, consider:
which throws
|
Lines 1223 to 1226 in 7544b18
|
Originally found here, the issue is a error message for incorrect code is very misleading. Here is a minimum working example:
The issue is that Float64 does not match Int, which causes an error. However, the error message is:
The reason why this is confusing is because it says the issue is with A being of type AbstractArray{T, N} and that the actual type is Vector{Float64}. Vector is of type AbstractArray, and Float64 is a type. Therefore, I could not figure out why this is wrong because it does seem like the type of A given, Vector{Float64}, is a valid type of A, AbstractArray{T}.
It would be nice if the error message specified that the given Types were wrong because Float64 does not match Int and therefore T is being redefined.
Note in this example it may seem obvious, but this can become quite confusing for a more complicated struct.
If version is relevant:
The text was updated successfully, but these errors were encountered: