Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KacperFKorban
Copy link
Member

closes #20511

Comment on lines -1980 to -1981
if !tp.isErroneous then
throw new java.lang.Error(i"internal error: closing over non-method $tp, pos = ${tree.span}")
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add the checkfiles. Thanks.

Note that with this fix, the produced error message is not helpful at all and confuses even more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotty crashes while compiling this file (its an invalid scala program)
3 participants