We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49dd708 commit a6ce0acCopy full SHA for a6ce0ac
compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala
@@ -36,11 +36,10 @@ class CheckNoSuperThis extends MiniPhase:
36
fail(t)
37
case t: RefTree => t.tpe match
38
case tpe @ TermRef(prefix, _)
39
- if prefix == cls.thisType && !tpe.symbol.is(JavaStatic) => fail(t)
40
- case tpe @ TermRef(prefix, _)
41
- if cls.is(Module) && prefix.termSymbol == cls.sourceModule && !tpe.symbol.is(JavaStatic) => fail(t)
42
43
- if cls.is(Module) && tpe.symbol == cls.sourceModule => fail(t)
+ if (prefix == cls.thisType
+ || cls.is(Module)
+ && (prefix.termSymbol == cls.sourceModule || tpe.symbol == cls.sourceModule)
+ ) && !tpe.symbol.is(JavaStatic) => fail(t)
44
case _ =>
45
46
}
0 commit comments