From 781988752d3cd8997241a692e41dc0d648533cee Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 13 Feb 2017 18:01:33 +0100 Subject: deferredAnnot: Avoid harmless capture of Context The capture context was only used to get its phase so shouldn't cause any problem. --- .../src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index b01f6cc6a..3a2a45fd2 100644 --- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -932,9 +932,10 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas protected def deferredAnnot(end: Int)(implicit ctx: Context): Annotation = { val start = readIndex val atp = readTypeRef() + val phase = ctx.phase Annotation.deferred( - atp.typeSymbol, implicit ctx1 => - atReadPos(start, () => readAnnotationContents(end)(ctx1.withPhase(ctx.phase)))) + atp.typeSymbol, implicit ctx => + atReadPos(start, () => readAnnotationContents(end)(ctx.withPhase(phase)))) } /* Read an abstract syntax tree */ -- cgit v1.2.3