Skip to content

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 23, 2021

Ensuring that the first parent of a class or trait is a class is done in completion.
But at that point some necessary info might not be computed yet, since not all base classes
of parent classes are guaranteed to be known at that point. We cannot move the transform
to regular typing since that breaks too many assumptions.
Instead we detect the problematic case in Namer and recompute the superclass in Typer.

Fixes #12722

When computing an implied superclass in `ensureFirstIsClass` we might
get the wrong class because some parent classes don't have their parents
set yet. Detect that case and recompute the superclass in Typer.
@odersky odersky changed the title Do ensureFirstIsClass in Typer instead of Namer Detect provisional superclasses and recompute in Typer Jun 23, 2021
@odersky odersky requested a review from nicolasstucki June 24, 2021 10:44
@odersky odersky merged commit 1420d6a into scala:master Jul 6, 2021
@odersky odersky deleted the fix-12722 branch July 6, 2021 14:00
@@ -18,6 +18,7 @@ object MiMaFilters {
exclude[MissingClassProblem]("scala.annotation.experimental"),
exclude[MissingClassProblem]("scala.annotation.internal.ErasedParam"),
exclude[MissingClassProblem]("scala.annotation.internal.ErasedParam"),
exclude[MissingClassProblem]("scala.annotation.internal.ProvisionalSuperClass"),
Copy link
Member

Choose a reason for hiding this comment

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

Btw there's glob support in mima's exclusions so you can use scala.annotation.internal.* here next time.

@Kordyjan Kordyjan added this to the 3.0.2 milestone Aug 2, 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.

Spurious "illegal trait inheritance"
4 participants