File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,17 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
144
144
/** Is a reference to a class but not `this.type` */
145
145
def isClassRef = sym.isClass && ! tp.isInstanceOf [ThisType ]
146
146
147
- if (! sym.exists || levelOK(sym))
147
+ /** Is this a static path or a type porjection with a static prefix */
148
+ def isStaticPathOK (tp1 : Type ): Boolean = tp1 match {
149
+ case tp1 : TypeRef => tp1.symbol.is(Package ) || isStaticPathOK(tp1.prefix)
150
+ case tp1 : TermRef => tp1.symbol.isStaticOwner || isStaticPathOK(tp1.prefix)
151
+ case tp1 : ThisType => tp1.tref.symbol.is(Package ) || tp1.tref.symbol.is(Module )
152
+ case tp1 : AppliedType => isStaticPathOK(tp1.tycon)
153
+ case _ : SkolemType => true
154
+ case _ => false
155
+ }
156
+
157
+ if (! sym.exists || levelOK(sym) || isStaticPathOK(tp))
148
158
None
149
159
else if (! sym.isStaticOwner && ! isClassRef)
150
160
tryHeal(sym, tp, pos)
@@ -171,7 +181,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
171
181
sym.isClass // reference to this in inline methods
172
182
)
173
183
case None =>
174
- ! sym.is(Param ) || levelOK(sym.owner)
184
+ sym.is(Package ) || sym.owner.isStaticOwner || levelOK(sym.owner)
175
185
}
176
186
177
187
/** Try to heal phase-inconsistent reference to type `T` using a local type definition.
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments