-
Notifications
You must be signed in to change notification settings - Fork 13k
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
better error message when there is a missing semicolon with an expression #1481
Comments
My first change to the typechecking code. I'm not very confident this is the "easy-ish" fix @nikomatsakis mentioned. Please help review. It passed tests on all bots. |
I don't think that's quite I had in mind. If I read the patch correctly, won't the new msg trigger anytime you unify unit type with non-unit type? I had in mind replacing the line |
One other thing... this may not be a tiny patch, because it seems like using the unify routines is the right thing to be doing, but we want to change the error msg. Maybe passing in some context to the unify routine to influence the error it emits is the right thing to do...? |
OK, last comment: what I am specifically concerned about is something like a function with type signature " fn(A)->A", where it might not be fully resolvable but could still be unified to unit. |
Thanks a lot for the information, Niko! I will try again when I understood how it works. |
Removing the comment, the error message now is:
which is a parser error rather than a type error. So I think that's close enough to what we wanted. |
Allow MaybeUninit in input and output of inline assembly
Something like:
will yield an error something like the one above. It would be better if it said, "statement with non-unit return type requires a semicolon" or something like that. This would be easy-ish to fix: the ast has a type "stmt_expr" and "stmt_semi", and "stmt_expr" must have a unit type.
The text was updated successfully, but these errors were encountered: