Skip to content

Commit 4d7c533

Browse files
oderskymichelou
authored andcommitted
Alternative fix: Make annotation reading lazier
Fixes scala#12109 without causing problems elsewhere.
1 parent a88ed69 commit 4d7c533

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
792792
OrType(args(0), args(1), soft = false)
793793
}
794794
else if (args.nonEmpty) tycon.safeAppliedTo(EtaExpandIfHK(sym.typeParams, args.map(translateTempPoly)))
795-
//else if (sym.typeParams.nonEmpty) tycon.EtaExpand(sym.typeParams)
795+
else if (sym.typeParams.nonEmpty) tycon.EtaExpand(sym.typeParams)
796796
else tycon
797797
case TYPEBOUNDStpe =>
798798
val lo = readTypeRef()
@@ -1011,9 +1011,9 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
10111011
*/
10121012
protected def deferredAnnot(end: Int)(using Context): Annotation = {
10131013
val start = readIndex
1014-
val atp = readTypeRef()
10151014
val phase = ctx.phase
1016-
Annotation.deferred(atp.typeSymbol)(
1015+
Annotation.deferredSymAndTree(
1016+
atReadPos(start, () => atPhase(phase)(readTypeRef().typeSymbol)))(
10171017
atReadPos(start, () => atPhase(phase)(readAnnotationContents(end))))
10181018
}
10191019

0 commit comments

Comments
 (0)