diff options
-rw-r--r-- | README.rst | 2 | ||||
-rw-r--r-- | src/compiler/scala/reflect/internal/AnnotationInfos.scala | 9 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/LiftCode.scala | 2 | ||||
-rw-r--r-- | src/library/scala/reflect/api/Trees.scala | 2 |
4 files changed, 13 insertions, 2 deletions
diff --git a/README.rst b/README.rst index ee87fe0fce..951e1ce17c 100644 --- a/README.rst +++ b/README.rst @@ -164,7 +164,7 @@ Many of these targets offer a variant which runs with -optimise enabled. Optimized targets include build-opt, test-opt, dist-opt, fastdist-opt, replacestarr-opt, replacelocker-opt, and distpack-opt. -Part V. Contributing to Scala +Part IV. Contributing to Scala -------------------------------------------------------------------------------- If you wish to contribute, you can find all of the necessary information on diff --git a/src/compiler/scala/reflect/internal/AnnotationInfos.scala b/src/compiler/scala/reflect/internal/AnnotationInfos.scala index 22c56642a7..665e33e783 100644 --- a/src/compiler/scala/reflect/internal/AnnotationInfos.scala +++ b/src/compiler/scala/reflect/internal/AnnotationInfos.scala @@ -128,7 +128,12 @@ trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable => */ final class LazyAnnotationInfo(lazyInfo: => AnnotationInfo) extends AnnotationInfo { private var forced = false - private lazy val forcedInfo = try lazyInfo finally forced = true + private lazy val forcedInfo = + try { + val result = lazyInfo + if (result.pos == NoPosition) result setPos pos + result + } finally forced = true def atp: Type = forcedInfo.atp def args: List[Tree] = forcedInfo.args @@ -136,6 +141,8 @@ trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable => // We should always be able to print things without forcing them. override def toString = if (forced) forcedInfo.toString else "@<?>" + + override def pos: Position = if (forced) forcedInfo.pos else NoPosition } /** Typed information about an annotation. It can be attached to either diff --git a/src/compiler/scala/tools/nsc/transform/LiftCode.scala b/src/compiler/scala/tools/nsc/transform/LiftCode.scala index 08e35ff6c3..7a64fc9b5e 100644 --- a/src/compiler/scala/tools/nsc/transform/LiftCode.scala +++ b/src/compiler/scala/tools/nsc/transform/LiftCode.scala @@ -476,6 +476,8 @@ abstract class LiftCode extends Transform with TypingTransformers { if (!(boundSyms exists (tt.tpe contains _))) mirrorCall("TypeTree", reifyType(tt.tpe)) else if (tt.original != null) reify(tt.original) else TypeTree() + case global.emptyValDef => + mirrorSelect("emptyValDef") case _ => if (tree.isDef) boundSyms += tree.symbol diff --git a/src/library/scala/reflect/api/Trees.scala b/src/library/scala/reflect/api/Trees.scala index 20f20890e8..752319d9a4 100644 --- a/src/library/scala/reflect/api/Trees.scala +++ b/src/library/scala/reflect/api/Trees.scala @@ -624,6 +624,8 @@ trait Trees /*extends reflect.generic.Trees*/ { self: Universe => } def TypeTree(tp: Type): TypeTree = TypeTree() setType tp + + def emptyValDef: ValDef // ------ traversers, copiers, and transformers --------------------------------------------- |