-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix ICE when reporting closure and proc mismatch #13657
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
Conversation
let _xs = nums.map(proc(n) {n * 2}); //~ ERROR mismatched types | ||
|
||
spawn(|| {}); //~ ERROR mismatched types | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you expand these error messages a bit more to have some more of the message itself? I've also found it useful to minimize test cases to just this one file (as little dependence on libstd) if possible (but not necessary)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, fixed.
r? |
//~^ ERROR mismatched types: expected `||` but found `proc()` (expected closure, found proc) | ||
|
||
expect_proc(|| {}); | ||
//~^ ERROR mismatched types: expected `proc()` but found `once ||` (expected proc, found closure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error seems a bit misleading because I think most aren't aware that once ||
is even a thing (it's feature gated anyway). Perhaps we could remove the expected_onceness
argument (in check_expr_fn
above)? That looks like it may print the right thing at that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a little bit more complicated than that. Fixed.
…s-to-early collect attribute spans early for disallowed macros
Closes #13599