Skip to content

Commit 371aee9

Browse files
DarkDimiussmarter
authored andcommitted
Workaround scala#348, linkedClass is broken after flatten
1 parent 15f09cf commit 371aee9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,12 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
493493
def superClass: Symbol = toDenot(sym).superClass
494494
def enclClass: Symbol = toDenot(sym).enclosingClass
495495
def linkedClassOfClass: Symbol = linkedClass
496-
def linkedClass: Symbol = toDenot(sym).linkedClass //exitingPickler(sym.linkedClassOfClass)
496+
def linkedClass: Symbol = {
497+
val ct = ctx.withPhase(ctx.flattenPhase.prev)
498+
toDenot(sym)(ct).linkedClass(ct)
499+
// java.util.Attributes.Name$ -> java$util$Attributes$Name$ no companion class after flatten
500+
// see bug #348
501+
} //exitingPickler(sym.linkedClassOfClass)
497502
def companionClass: Symbol = toDenot(sym).companionClass
498503
def companionModule: Symbol = toDenot(sym).companionModule
499504
def companionSymbol: Symbol = if (sym is Flags.Module) companionClass else companionModule

0 commit comments

Comments
 (0)