Skip to content

Avoid classcast exception in IDE #4445

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

Merged
merged 1 commit into from
May 7, 2018
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 2, 2018

We assumed that the toplevel class is always a ClassSymbol, but that assumption was wrong
in some code I was editing, which caused a crash at the point where the fix is done.

@odersky odersky changed the title Avoid classcast exception Avoid classcast exception in IDE May 2, 2018
@odersky odersky requested a review from Duhemm May 2, 2018 16:54
@Blaisorblade
Copy link
Contributor

What else did you find and what sort of code caused it? And how would this be tested?
Of course it's good to fix the issue, but without tests maintaining this code will get harder later.

@smarter
Copy link
Member

smarter commented May 4, 2018

I've sene this happen too, NoSymbol can pop up here in code with parse errors.

Copy link
Contributor

@Duhemm Duhemm left a comment

Choose a reason for hiding this comment

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

Maybe that we should also add comments to all these hardening fixes to make sure that we don't revert them by accident...?

@odersky
Copy link
Contributor Author

odersky commented May 7, 2018

Agree it would be good to have tests. Maybe comments as well. Or we appeal that people should use git blame before they optimize some code that looks deliberately defensive.

@odersky odersky merged commit ddf10a2 into scala:master May 7, 2018
@allanrenucci allanrenucci deleted the harden-ide-12 branch May 7, 2018 13:59
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.

4 participants