File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -147,14 +147,10 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
147147 * `Some(tree)` with the `tree` of the healed type tree for `${implicitly[quoted.Type[T]]}`
148148 */
149149 private def checkSymLevel (sym : Symbol , tp : Type , pos : SourcePosition )(implicit ctx : Context ): Option [Tree ] = {
150- val isThis = tp.isInstanceOf [ThisType ]
151- val shouldTryHealable = {
152- // TODO move logic to levelOK
153- tp.isInstanceOf [ThisType ] ||
154- sym.is(Param ) ||
155- ! sym.maybeOwner.isType
156- }
157- if (sym.exists && ! sym.isStaticOwner && ! levelOK(sym) && shouldTryHealable)
150+ /** Is a reference to a class but not `this.type` */
151+ def isClassRef = sym.isClass && ! tp.isInstanceOf [ThisType ]
152+
153+ if (sym.exists && ! sym.isStaticOwner && ! isClassRef && ! levelOK(sym))
158154 tryHeal(sym, tp, pos)
159155 else
160156 None
You can’t perform that action at this time.
0 commit comments