Skip to content

Commit 63151c7

Browse files
committed
Alternative fix: Make annotation reading lazier
Fixes scala#12109 without causing problems elsewhere.
1 parent b3c9e59 commit 63151c7

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
@@ -788,7 +788,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
788788
OrType(args(0), args(1), soft = false)
789789
}
790790
else if (args.nonEmpty) tycon.safeAppliedTo(EtaExpandIfHK(sym.typeParams, args.map(translateTempPoly)))
791-
//else if (sym.typeParams.nonEmpty) tycon.EtaExpand(sym.typeParams)
791+
else if (sym.typeParams.nonEmpty) tycon.EtaExpand(sym.typeParams)
792792
else tycon
793793
case TYPEBOUNDStpe =>
794794
val lo = readTypeRef()
@@ -1007,9 +1007,9 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
10071007
*/
10081008
protected def deferredAnnot(end: Int)(using Context): Annotation = {
10091009
val start = readIndex
1010-
val atp = readTypeRef()
10111010
val phase = ctx.phase
1012-
Annotation.deferred(atp.typeSymbol)(
1011+
Annotation.deferredSymAndTree(
1012+
atReadPos(start, () => atPhase(phase)(readTypeRef().typeSymbol)))(
10131013
atReadPos(start, () => atPhase(phase)(readAnnotationContents(end))))
10141014
}
10151015

0 commit comments

Comments
 (0)