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
bad explicitouter/erasure interaction regarding transform of isInstanceOf[Outer.this.Module.type] to eq(Outer.this.Module) #7598
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7598?orig=1
|
Andreas Nyberg (middlewareman) said: |
@retronym said: class Outer {
object X
class Inner {
null.isInstanceOf[X.type]
}
} Erasure converts instanceOf tests against singleton types to targ.tpe match {
case SingleType(_, _) | ThisType(_) | SuperType(_, _) =>
val cmpOp = if (targ.tpe <:< AnyValTpe) Any_equals else Object_eq
atPos(tree.pos) {
Apply(Select(qual, cmpOp), List(gen.mkAttributedQualifier(targ.tpe)))
} After erasure: class Outer$Inner#8101 extends Object#145 {
<synthetic> <paramaccessor> <artifact> protected val $outer#15239: Outer#7816 = _;
<synthetic> <stable> <artifact> def $outer#15238(): Outer#7816 = Outer$Inner#8101.this.$outer#15239;
def <init>#13449($outer#15240: Outer#7816): Outer$Inner#8101 = {
if ($outer#15240.eq#5861(null))
throw null
else
Outer$Inner#8101.this.$outer#15239 = $outer#15240;
Outer$Inner#8101.super.<init>#3011();
null.eq#5861(Outer#7816.this.X#8099());
()
} We either need explicit outer to transform TypeTrees to subsitute |
@retronym said: |
@adriaanm said: |
@retronym said: |
@adriaanm said: |
Somehow, some way, got fixed in 2.13.6 – no compiler crash. Remains fixed in 3.2.2. |
scala/scala#9504 perchance but the retronym minimization waited for scala/scala#9581 fixing #12312 which I must have hit while typing idly into REPL during pandemic? |
I have not tried compiling outside Eclipse.
The text was updated successfully, but these errors were encountered: