Skip to content

[backport] Fixes to backport of new precedence warning#10314

Merged
dwijnand merged 1 commit intoscala:2.12.xfrom
lrytz:t11921-backport-fixes
Feb 18, 2023
Merged

[backport] Fixes to backport of new precedence warning#10314
dwijnand merged 1 commit intoscala:2.12.xfrom
lrytz:t11921-backport-fixes

Conversation

@lrytz
Copy link
Copy Markdown
Member

@lrytz lrytz commented Feb 16, 2023

This is a follow-up for #10297 that fixes false positive ambiguity warnings.

This is a follow-up for PR 10297 that fixes false positive ambiguity
warnings.
@lrytz lrytz requested a review from dwijnand February 16, 2023 13:22
@scala-jenkins scala-jenkins added this to the 2.12.18 milestone Feb 16, 2023
val defPre = pre
val defCx = cx

while ((cx ne NoContext) && (cx.owner == defCx.owner || cx.depth >= symbolDepth)) cx = cx.outer
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is added; in 2.13:

while ((cx ne NoContext) && cx.depth >= symbolDepth) cx = cx.outer
if (wasFoundInSuper)
while ((cx ne NoContext) && (cx.owner eq cx0.owner)) cx = cx.outer

Comment on lines +1289 to +1290
if (outerDefSym == defSym)
outerDefSym = NoSymbol
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is added; in 2.13:

if (defSym.exists && (defSym ne defSym0)) {

if (symbolDepth < 0)
symbolDepth = cx.depth

def checkAmbiguousWithEnclosing(): Unit = if (foundInSuper && !thisContext.unit.isJava) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

isJava is added; in 2.13:

if (possiblyAmbiguousDefinition && !thisContext.unit.isJava) {

@dwijnand dwijnand merged commit 2b9b862 into scala:2.12.x Feb 18, 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.

3 participants