aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-02-13 18:01:33 +0100
committerGuillaume Martres <smarter@ubuntu.com>2017-02-18 23:35:34 +0100
commit781988752d3cd8997241a692e41dc0d648533cee (patch)
tree73945db13997b066476703f80de63eb3e7e6bb39
parentf3f1c4623b3815f1385317190bf72baabd98fdff (diff)
downloaddotty-781988752d3cd8997241a692e41dc0d648533cee.tar.gz
dotty-781988752d3cd8997241a692e41dc0d648533cee.tar.bz2
dotty-781988752d3cd8997241a692e41dc0d648533cee.zip
deferredAnnot: Avoid harmless capture of Context
The capture context was only used to get its phase so shouldn't cause any problem.
-rw-r--r--compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala5
1 files changed, 3 insertions, 2 deletions
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 */