File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -148,9 +148,13 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
148148 */
149149 private def checkSymLevel (sym : Symbol , tp : Type , pos : SourcePosition )(implicit ctx : Context ): Option [Tree ] = {
150150 val isThis = tp.isInstanceOf [ThisType ]
151- if (! isThis && ! sym.is(Param ) && sym.maybeOwner.isType)
152- None
153- else if (sym.exists && ! sym.isStaticOwner && ! levelOK(sym))
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)
154158 tryHeal(sym, tp, pos)
155159 else
156160 None
You can’t perform that action at this time.
0 commit comments