@@ -351,15 +351,15 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
351
351
val isTopLevel = innerClassSym.rawowner.isPackageClass
352
352
// impl classes are considered top-level, see comment in BTypes
353
353
if (isTopLevel || considerAsTopLevelImplementationArtifact(innerClassSym)) None
354
- else if (innerClassSym.rawowner.isTerm)
355
- // SI-9392 An errant macro might leave a reference to a local class symbol that no longer exists in the tree,
356
- // this avoids an assertion error in that case. AFAICT, we don't actually need the `NestedInfo` for all BTypes,
357
- // only for ones that describe classes defined in the trees that reach the backend, so this is safe enough .
358
- //
359
- // TODO Can we avoid creating `NestedInfo` for each type that is referred to, and instead only create if for
360
- // symbols of ClassDefs?
354
+ else if (innerClassSym.rawowner.isTerm) {
355
+ // This case should never be reached: the lambdalift phase mutates the rawowner field of all
356
+ // classes to be the enclosing class. SI-9392 shows an errant macro that leaves a reference
357
+ // to a local class symbol that no longer exists, which is not updated by lambdalift .
358
+ devWarning(innerClassSym.pos,
359
+ s """ The class symbol $innerClassSym with the term symbol ${innerClassSym.rawowner} as `rawowner` reached the backend.
360
+ |Most likely this indicates a stale reference to a non-existing class introduced by a macro, see SI-9392. """ .stripMargin)
361
361
None
362
- else {
362
+ } else {
363
363
// See comment in BTypes, when is a class marked static in the InnerClass table.
364
364
val isStaticNestedClass = isOriginallyStaticOwner(innerClassSym.originalOwner)
365
365
0 commit comments