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

Avoid stackoverflow in ExplicitOuter #16381

Merged
merged 1 commit into from
Nov 19, 2022
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 19, 2022

When transforming a class at ExplicitOuter we create outer accessors for it. The newSymbol call to do this takes place at phase ExplicitOuter + 1, but its arguments need to be evaluated at phase ExplicitOuter. This was not true for the nestingLevel argument, which demanded the denotation of the class at phase ExplicitOuter + 1, thus leading to the SO.

Interestingly, the same path is not taken if the class has all abstract members defined or is declared abstract. It's only in the error case that I could reproduce the SO.

Fixes #16343

When transforming a class at ExplicitOuter we create outer accessors for it.
The newSymbol call to do this takes place at phase ExplicitOuter + 1, but
its arguments need to be evaluated at phase ExplicitOuter. This was not true
for the nestingLevel argument, which demanded the denotation of the class
at phase ExplicitOuter + 1, thus leading to the SO.

Interestingly, the same path is not taken if the class has all abstract members defined
or is declared abstract. It's only in the error case that I could reproduce the SO.
@odersky odersky merged commit 27f4a94 into scala:main Nov 19, 2022
@odersky odersky deleted the fix-16343 branch November 19, 2022 13:18
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 2023
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.

extending javax.swing.SwingWorker from inner class causes crash
3 participants