Skip to content

Fix computation of class nesting level in inliner #15671

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 2 commits into from
Jul 14, 2022

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jul 13, 2022

Fixes #15666

@@ -270,12 +270,15 @@ class Inliner(val call: tpd.Tree)(using Context):
assert(argss.isEmpty)
true

/** The number of enclosing classes of this class, plus one */
private def nestingLevel(cls: Symbol) = cls.ownersIterator.count(_.isClass)
Copy link
Member

Choose a reason for hiding this comment

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

maybe call it outerLevel to avoid confusion with ctx.nestingLevel used in level-checking?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed it to classNestingLevel.

@odersky odersky merged commit cb4f807 into scala:main Jul 14, 2022
@odersky odersky deleted the fix-15666 branch July 14, 2022 15:02
@Kordyjan Kordyjan added the backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" label Jul 26, 2022
@Kordyjan Kordyjan added this to the 3.2.0 backports milestone Jul 26, 2022
@Kordyjan Kordyjan added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Jul 26, 2022
Kordyjan added a commit that referenced this pull request Jul 27, 2022
Backport #15671: Fix computation of class nesting level in inliner
@Kordyjan Kordyjan modified the milestones: 3.2.0 backports, 3.2.1 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure in construction of path for outer accessor
5 participants