Skip to content

Commit 1396178

Browse files
committed
Try to avoid cyclic reference errors in community build
1 parent 7af35bd commit 1396178

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,9 @@ class Namer { typer: Typer =>
920920
end if
921921
}
922922

923-
protected def cookIfJava(tp: Type)(using Context): Type =
924-
if ctx.compilationUnit.isJava then ClassfileParser.cook.apply(tp) else tp
923+
protected def cookIfJava(denot: SymDenotation)(using Context): Unit =
924+
if ctx.compilationUnit.isJava then
925+
denot.info = ClassfileParser.cook.apply(denot.info)
925926

926927
/** Intentionally left without `implicit ctx` parameter. We need
927928
* to pick up the context at the point where the completer was created.
@@ -933,7 +934,8 @@ class Namer { typer: Typer =>
933934
denot.info = typeSig(sym)
934935
invalidateIfClashingSynthetic(denot)
935936
Checking.checkWellFormed(sym)
936-
denot.info = cookIfJava(avoidPrivateLeaks(sym))
937+
denot.info = avoidPrivateLeaks(sym)
938+
cookIfJava(denot)
937939
}
938940
}
939941

@@ -1292,7 +1294,8 @@ class Namer { typer: Typer =>
12921294

12931295
Checking.checkWellFormed(cls)
12941296
if (isDerivedValueClass(cls)) cls.setFlag(Final)
1295-
cls.info = cookIfJava(avoidPrivateLeaks(cls))
1297+
cls.info = avoidPrivateLeaks(cls)
1298+
cookIfJava(cls)
12961299
cls.baseClasses.foreach(_.invalidateBaseTypeCache()) // we might have looked before and found nothing
12971300
cls.setNoInitsFlags(parentsKind(parents), untpd.bodyKind(rest))
12981301
if (cls.isNoInitsClass) cls.primaryConstructor.setFlag(StableRealizable)

0 commit comments

Comments
 (0)