-
-
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
Inaccurate printing of TypeError message #35231
Comments
The behaviour is correct, no? In the first case, the function expects a Type for the second argument, and you passed it Maybe it could be phrased better as: |
I think the issue is that the error messages, while accurate, could be clearer. |
While the examples below are clear cases where the user did not RTFM, they are still confusing and we could improve the error message:
isa
Int64
is a Type so we should prompt that the user passed the value1
instead of aType
:Expected:
ERROR: TypeError: in isa, expected Type, got 1.
Union
Similar to
isa(Nothing, nothing)
that yields a similar error.Expected:
ERROR: TypeError: in isa, expected Type, got nothing.
As far as I can see, this part of the string in the
TypeError
message is generated by the macro @nospecialize in Base.The text was updated successfully, but these errors were encountered: