Skip to content

Commit 7f4d4fb

Browse files
committed
deferredAnnot: Avoid harmless capture of Context
The capture context was only used to get its phase so shouldn't cause any problem.
1 parent b297832 commit 7f4d4fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,9 +932,10 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
932932
protected def deferredAnnot(end: Int)(implicit ctx: Context): Annotation = {
933933
val start = readIndex
934934
val atp = readTypeRef()
935+
val phase = ctx.phase
935936
Annotation.deferred(
936-
atp.typeSymbol, implicit ctx1 =>
937-
atReadPos(start, () => readAnnotationContents(end)(ctx1.withPhase(ctx.phase))))
937+
atp.typeSymbol, implicit ctx =>
938+
atReadPos(start, () => readAnnotationContents(end)(ctx.withPhase(phase))))
938939
}
939940

940941
/* Read an abstract syntax tree */

0 commit comments

Comments
 (0)