-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Do not crash when typing a closure with unknown type, since it can occur for erroneous input #21178
Conversation
…cur for erroneous input
6299833
to
ec5cbcc
Compare
if !tp.isErroneous then | ||
throw new java.lang.Error(i"internal error: closing over non-method $tp, pos = ${tree.span}") |
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.
I don't think this is the correct fix. IMHO, for this kind of errors, we shouldn't run the typer in the first place.
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.
Hmmm, I think that this might actually be the correct fix. I even tried short-circuiting before typing ahead in Namer, but the presentation compiler leverages this for completions.
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.
Alright, but we should open an issue for a better error messages !
if !tp.isErroneous then | ||
throw new java.lang.Error(i"internal error: closing over non-method $tp, pos = ${tree.span}") |
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.
Alright, but we should open an issue for a better error messages !
closes #20511