summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-14 16:45:54 -0700
committerEugene Burmako <xeno.by@gmail.com>2012-09-14 16:45:54 -0700
commit24580ac84242679619d27f20258078dd012c120a (patch)
tree524b667c209c45e05c95f88d6bd6e6c3d34abdef /src/reflect
parentb61a2e31d27e6496ad5ac96758fe8003719cacb0 (diff)
parente6176afdcdb7abffdee8a6f8d5e58790f8f905fc (diff)
downloadscala-24580ac84242679619d27f20258078dd012c120a.tar.gz
scala-24580ac84242679619d27f20258078dd012c120a.tar.bz2
scala-24580ac84242679619d27f20258078dd012c120a.zip
Merge pull request #1302 from scalamacros/topic/reflection
cleaning up reflection
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/api/AnnotationInfos.scala27
-rw-r--r--src/reflect/scala/reflect/api/Annotations.scala29
-rw-r--r--src/reflect/scala/reflect/api/Symbols.scala9
-rw-r--r--src/reflect/scala/reflect/api/Trees.scala9
-rw-r--r--src/reflect/scala/reflect/api/Types.scala11
-rw-r--r--src/reflect/scala/reflect/api/Universe.scala2
-rw-r--r--src/reflect/scala/reflect/internal/AnnotationInfos.scala73
-rw-r--r--src/reflect/scala/reflect/internal/StdAttachments.scala2
-rw-r--r--src/reflect/scala/reflect/internal/StdNames.scala2
-rw-r--r--src/reflect/scala/reflect/internal/Symbols.scala2
-rw-r--r--src/reflect/scala/reflect/internal/Trees.scala14
-rw-r--r--src/reflect/scala/reflect/internal/pickling/UnPickler.scala2
-rw-r--r--src/reflect/scala/reflect/macros/Infrastructure.scala21
-rw-r--r--src/reflect/scala/reflect/macros/Parsers.scala2
-rw-r--r--src/reflect/scala/reflect/macros/Universe.scala4
-rw-r--r--src/reflect/scala/reflect/runtime/JavaUniverse.scala2
16 files changed, 96 insertions, 115 deletions
diff --git a/src/reflect/scala/reflect/api/AnnotationInfos.scala b/src/reflect/scala/reflect/api/AnnotationInfos.scala
deleted file mode 100644
index d9f35024d9..0000000000
--- a/src/reflect/scala/reflect/api/AnnotationInfos.scala
+++ /dev/null
@@ -1,27 +0,0 @@
-package scala.reflect
-package api
-
-trait AnnotationInfos extends base.AnnotationInfos { self: Universe =>
-
- override type AnnotationInfo >: Null <: AnyRef with AnnotationInfoApi
- trait AnnotationInfoApi {
- def atp: Type
- def args: List[Tree]
- def assocs: List[(Name, ClassfileAnnotArg)]
- }
-
- override type LiteralAnnotArg >: Null <: ClassfileAnnotArg with LiteralAnnotArgApi
- trait LiteralAnnotArgApi {
- def const: Constant
- }
-
- override type ArrayAnnotArg >: Null <: ClassfileAnnotArg with ArrayAnnotArgApi
- trait ArrayAnnotArgApi {
- def args: Array[ClassfileAnnotArg]
- }
-
- override type NestedAnnotArg >: Null <: ClassfileAnnotArg with NestedAnnotArgApi
- trait NestedAnnotArgApi {
- def annInfo: AnnotationInfo
- }
-} \ No newline at end of file
diff --git a/src/reflect/scala/reflect/api/Annotations.scala b/src/reflect/scala/reflect/api/Annotations.scala
new file mode 100644
index 0000000000..43e95f9902
--- /dev/null
+++ b/src/reflect/scala/reflect/api/Annotations.scala
@@ -0,0 +1,29 @@
+package scala.reflect
+package api
+
+import scala.collection.immutable.ListMap
+
+trait Annotations extends base.Annotations { self: Universe =>
+
+ override type Annotation >: Null <: AnyRef with AnnotationApi
+ trait AnnotationApi {
+ def tpe: Type
+ def scalaArgs: List[Tree]
+ def javaArgs: ListMap[Name, JavaArgument]
+ }
+
+ override type LiteralArgument >: Null <: JavaArgument with LiteralArgumentApi
+ trait LiteralArgumentApi {
+ def value: Constant
+ }
+
+ override type ArrayArgument >: Null <: JavaArgument with ArrayArgumentApi
+ trait ArrayArgumentApi {
+ def args: Array[JavaArgument]
+ }
+
+ override type NestedArgument >: Null <: JavaArgument with NestedArgumentApi
+ trait NestedArgumentApi {
+ def annotation: Annotation
+ }
+} \ No newline at end of file
diff --git a/src/reflect/scala/reflect/api/Symbols.scala b/src/reflect/scala/reflect/api/Symbols.scala
index 1fbbc0c0a4..cf1f574ade 100644
--- a/src/reflect/scala/reflect/api/Symbols.scala
+++ b/src/reflect/scala/reflect/api/Symbols.scala
@@ -36,13 +36,8 @@ trait Symbols extends base.Symbols { self: Universe =>
// at scala.reflect.internal.pickling.UnPickler$Scan.run(UnPickler.scala:88)
// at scala.reflect.internal.pickling.UnPickler.unpickle(UnPickler.scala:37)
// at scala.reflect.runtime.JavaMirrors$JavaMirror.unpickleClass(JavaMirrors.scala:253) // unpickle from within a reflexive mirror
- // def annotations: List[AnnotationInfo]
- def getAnnotations: List[AnnotationInfo]
-
- /** Whether this symbol carries an annotation for which the given
- * symbol is its typeSymbol.
- */
- def hasAnnotation(sym: Symbol): Boolean
+ // def annotations: List[Annotation]
+ def getAnnotations: List[Annotation]
/** For a class: the module or case class factory with the same name in the same package.
* For a module: the class with the same name in the same package.
diff --git a/src/reflect/scala/reflect/api/Trees.scala b/src/reflect/scala/reflect/api/Trees.scala
index 5522693b29..e46a977be8 100644
--- a/src/reflect/scala/reflect/api/Trees.scala
+++ b/src/reflect/scala/reflect/api/Trees.scala
@@ -424,14 +424,6 @@ trait Trees extends base.Trees { self: Universe =>
trait ApplyApi extends GenericApplyApi { this: Apply =>
}
- override type ApplyDynamic >: Null <: TermTree with SymTree with ApplyDynamicApi
-
- /** The API that all apply dynamics support */
- trait ApplyDynamicApi extends TermTreeApi with SymTreeApi { this: ApplyDynamic =>
- val qual: Tree
- val args: List[Tree]
- }
-
override type Super >: Null <: TermTree with SuperApi
/** The API that all supers support */
@@ -586,7 +578,6 @@ trait Trees extends base.Trees { self: Universe =>
def Typed(tree: Tree, expr: Tree, tpt: Tree): Typed
def TypeApply(tree: Tree, fun: Tree, args: List[Tree]): TypeApply
def Apply(tree: Tree, fun: Tree, args: List[Tree]): Apply
- def ApplyDynamic(tree: Tree, qual: Tree, args: List[Tree]): ApplyDynamic
def Super(tree: Tree, qual: Tree, mix: TypeName): Super
def This(tree: Tree, qual: Name): This
def Select(tree: Tree, qualifier: Tree, selector: Name): Select
diff --git a/src/reflect/scala/reflect/api/Types.scala b/src/reflect/scala/reflect/api/Types.scala
index f22f8d3e75..1c79de02c3 100644
--- a/src/reflect/scala/reflect/api/Types.scala
+++ b/src/reflect/scala/reflect/api/Types.scala
@@ -121,15 +121,6 @@ trait Types extends base.Types { self: Universe =>
*/
def widen: Type
- /** Map to a singleton type which is a subtype of this type.
- * The fallback implemented here gives:
- * {{{
- * T.narrow = (T {}).this.type
- * }}}
- * Overridden where we know more about where types come from.
- */
- def narrow: Type
-
/******************* helpers *******************/
/** Substitute symbols in `to` for corresponding occurrences of references to
@@ -264,7 +255,7 @@ trait Types extends base.Types { self: Universe =>
/** The API that all annotated types support */
trait AnnotatedTypeApi extends TypeApi { this: AnnotatedType =>
- val annotations: List[AnnotationInfo]
+ val annotations: List[Annotation]
val underlying: Type
val selfsym: Symbol
}
diff --git a/src/reflect/scala/reflect/api/Universe.scala b/src/reflect/scala/reflect/api/Universe.scala
index 3dce0f218e..3165f9abcd 100644
--- a/src/reflect/scala/reflect/api/Universe.scala
+++ b/src/reflect/scala/reflect/api/Universe.scala
@@ -14,4 +14,4 @@ abstract class Universe extends base.Universe
with StandardDefinitions
with StandardNames
with Importers
- with AnnotationInfos
+ with Annotations
diff --git a/src/reflect/scala/reflect/internal/AnnotationInfos.scala b/src/reflect/scala/reflect/internal/AnnotationInfos.scala
index a444c786f7..8853b872c0 100644
--- a/src/reflect/scala/reflect/internal/AnnotationInfos.scala
+++ b/src/reflect/scala/reflect/internal/AnnotationInfos.scala
@@ -9,9 +9,10 @@ package internal
import util._
import pickling.ByteCodecs
import scala.annotation.tailrec
+import scala.collection.immutable.ListMap
/** AnnotationInfo and its helpers */
-trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable =>
+trait AnnotationInfos extends api.Annotations { self: SymbolTable =>
import definitions.{ ThrowsClass, StaticAnnotationClass, isMetaAnnotation }
// Common annotation code between Symbol and Type.
@@ -32,7 +33,7 @@ trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable =>
case AnnotationInfo(tp, Literal(Constant(tpe: Type)) :: Nil, _) if tp.typeSymbol == ThrowsClass => tpe.typeSymbol
}
- /** Tests for, get, or remove an annotation */
+ /** Tests for, get, or remove an annotation */
def hasAnnotation(cls: Symbol): Boolean =
//OPT inlined from exists to save on #closures; was: annotations exists (_ matches cls)
dropOtherAnnotations(annotations, cls).nonEmpty
@@ -43,12 +44,12 @@ trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable =>
case ann :: _ => Some(ann)
case _ => None
}
-
+
def removeAnnotation(cls: Symbol): Self = filterAnnotations(ann => !(ann matches cls))
-
+
final def withAnnotation(annot: AnnotationInfo): Self = withAnnotations(List(annot))
- @tailrec private
+ @tailrec private
def dropOtherAnnotations(anns: List[AnnotationInfo], cls: Symbol): List[AnnotationInfo] = anns match {
case ann :: rest => if (ann matches cls) anns else dropOtherAnnotations(rest, cls)
case Nil => Nil
@@ -63,28 +64,46 @@ trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable =>
* - or nested classfile annotations
*/
abstract class ClassfileAnnotArg extends Product
- implicit val ClassfileAnnotArgTag = ClassTag[ClassfileAnnotArg](classOf[ClassfileAnnotArg])
+ implicit val JavaArgumentTag = ClassTag[ClassfileAnnotArg](classOf[ClassfileAnnotArg])
/** Represents a compile-time Constant (`Boolean`, `Byte`, `Short`,
* `Char`, `Int`, `Long`, `Float`, `Double`, `String`, `java.lang.Class` or
* an instance of a Java enumeration value).
*/
case class LiteralAnnotArg(const: Constant)
- extends ClassfileAnnotArg with LiteralAnnotArgApi {
+ extends ClassfileAnnotArg with LiteralArgumentApi {
+ def value = const
override def toString = const.escapedStringValue
}
- implicit val LiteralAnnotArgTag = ClassTag[LiteralAnnotArg](classOf[LiteralAnnotArg])
-
- object LiteralAnnotArg extends LiteralAnnotArgExtractor
+ object LiteralAnnotArg extends LiteralArgumentExtractor
/** Represents an array of classfile annotation arguments */
case class ArrayAnnotArg(args: Array[ClassfileAnnotArg])
- extends ClassfileAnnotArg with ArrayAnnotArgApi {
+ extends ClassfileAnnotArg with ArrayArgumentApi {
override def toString = args.mkString("[", ", ", "]")
}
- implicit val ArrayAnnotArgTag = ClassTag[ArrayAnnotArg](classOf[ArrayAnnotArg])
+ object ArrayAnnotArg extends ArrayArgumentExtractor
- object ArrayAnnotArg extends ArrayAnnotArgExtractor
+ /** Represents a nested classfile annotation */
+ case class NestedAnnotArg(annInfo: AnnotationInfo)
+ extends ClassfileAnnotArg with NestedArgumentApi {
+ // The nested annotation should not have any Scala annotation arguments
+ assert(annInfo.args.isEmpty, annInfo.args)
+ def annotation = annInfo
+ override def toString = annInfo.toString
+ }
+ object NestedAnnotArg extends NestedArgumentExtractor
+
+ type JavaArgument = ClassfileAnnotArg
+ type LiteralArgument = LiteralAnnotArg
+ val LiteralArgument = LiteralAnnotArg
+ implicit val LiteralArgumentTag = ClassTag[LiteralAnnotArg](classOf[LiteralAnnotArg])
+ type ArrayArgument = ArrayAnnotArg
+ val ArrayArgument = ArrayAnnotArg
+ implicit val ArrayArgumentTag = ClassTag[ArrayAnnotArg](classOf[ArrayAnnotArg])
+ type NestedArgument = NestedAnnotArg
+ val NestedArgument = NestedAnnotArg
+ implicit val NestedArgumentTag = ClassTag[NestedAnnotArg](classOf[NestedAnnotArg])
/** A specific annotation argument that encodes an array of bytes as an
* array of `Long`. The type of the argument declared in the annotation
@@ -121,20 +140,9 @@ trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable =>
}
src
}
-
}
- /** Represents a nested classfile annotation */
- case class NestedAnnotArg(annInfo: AnnotationInfo) extends ClassfileAnnotArg with NestedAnnotArgApi {
- // The nested annotation should not have any Scala annotation arguments
- assert(annInfo.args.isEmpty, annInfo.args)
- override def toString = annInfo.toString
- }
- implicit val NestedAnnotArgTag = ClassTag[NestedAnnotArg](classOf[NestedAnnotArg])
-
- object NestedAnnotArg extends NestedAnnotArgExtractor
-
- object AnnotationInfo extends AnnotationInfoExtractor {
+ object AnnotationInfo {
def marker(atp: Type): AnnotationInfo =
apply(atp, Nil, Nil)
@@ -207,11 +215,15 @@ trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable =>
*
* `assocs` stores arguments to classfile annotations as name-value pairs.
*/
- sealed abstract class AnnotationInfo extends AnnotationInfoApi {
+ sealed abstract class AnnotationInfo extends AnnotationApi {
def atp: Type
def args: List[Tree]
def assocs: List[(Name, ClassfileAnnotArg)]
+ def tpe = atp
+ def scalaArgs = args
+ def javaArgs = ListMap(assocs: _*)
+
// necessary for reification, see Reifiers.scala for more info
def original: Tree
def setOriginal(t: Tree): this.type
@@ -299,7 +311,14 @@ trait AnnotationInfos extends api.AnnotationInfos { self: SymbolTable =>
}
}
- implicit val AnnotationInfoTag = ClassTag[AnnotationInfo](classOf[AnnotationInfo])
+ type Annotation = AnnotationInfo
+ object Annotation extends AnnotationExtractor {
+ def apply(tpe: Type, scalaArgs: List[Tree], javaArgs: ListMap[Name, ClassfileAnnotArg]): Annotation =
+ AnnotationInfo(tpe, scalaArgs, javaArgs.toList)
+ def unapply(annotation: Annotation): Option[(Type, List[Tree], ListMap[Name, ClassfileAnnotArg])] =
+ Some((annotation.tpe, annotation.scalaArgs, annotation.javaArgs))
+ }
+ implicit val AnnotationTag = ClassTag[AnnotationInfo](classOf[AnnotationInfo])
object UnmappableAnnotation extends CompleteAnnotationInfo(NoType, Nil, Nil)
}
diff --git a/src/reflect/scala/reflect/internal/StdAttachments.scala b/src/reflect/scala/reflect/internal/StdAttachments.scala
index 60b3a6f436..5f6a3bf777 100644
--- a/src/reflect/scala/reflect/internal/StdAttachments.scala
+++ b/src/reflect/scala/reflect/internal/StdAttachments.scala
@@ -10,7 +10,7 @@ trait StdAttachments {
trait Attachable {
protected var rawatt: base.Attachments { type Pos = Position } = NoPosition
def attachments = rawatt
- def addAttachment(attachment: Any): this.type = { rawatt = rawatt.add(attachment); this }
+ def updateAttachment[T: ClassTag](attachment: T): this.type = { rawatt = rawatt.update(attachment); this }
def removeAttachment[T: ClassTag]: this.type = { rawatt = rawatt.remove[T]; this }
// cannot be final due to SynchronizedSymbols
diff --git a/src/reflect/scala/reflect/internal/StdNames.scala b/src/reflect/scala/reflect/internal/StdNames.scala
index e70531df6e..22f5b391b8 100644
--- a/src/reflect/scala/reflect/internal/StdNames.scala
+++ b/src/reflect/scala/reflect/internal/StdNames.scala
@@ -571,7 +571,7 @@ trait StdNames {
// Compiler utilized names
val AnnotatedType: NameType = "AnnotatedType"
- val AnnotationInfo: NameType = "AnnotationInfo"
+ val Annotation: NameType = "Annotation"
val Any: NameType = "Any"
val AnyVal: NameType = "AnyVal"
val AppliedTypeTree: NameType = "AppliedTypeTree"
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala
index 430cf58a54..be55b72623 100644
--- a/src/reflect/scala/reflect/internal/Symbols.scala
+++ b/src/reflect/scala/reflect/internal/Symbols.scala
@@ -1600,7 +1600,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
setInfo (this.info cloneInfo clone)
setAnnotations this.annotations
)
- this.attachments.all.foreach(clone.addAttachment)
+ this.attachments.all.foreach(clone.updateAttachment)
if (clone.thisSym != clone)
clone.typeOfThis = (clone.typeOfThis cloneInfo clone)
diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala
index a59f01155a..b20c315a2a 100644
--- a/src/reflect/scala/reflect/internal/Trees.scala
+++ b/src/reflect/scala/reflect/internal/Trees.scala
@@ -400,9 +400,7 @@ trait Trees extends api.Trees { self: SymbolTable =>
def ApplyConstructor(tpt: Tree, args: List[Tree]) = Apply(Select(New(tpt), nme.CONSTRUCTOR), args)
- case class ApplyDynamic(qual: Tree, args: List[Tree])
- extends SymTree with TermTree with ApplyDynamicApi
- object ApplyDynamic extends ApplyDynamicExtractor
+ case class ApplyDynamic(qual: Tree, args: List[Tree]) extends SymTree with TermTree
case class Super(qual: Tree, mix: TypeName) extends TermTree with SuperApi {
override def symbol: Symbol = qual.symbol
@@ -496,7 +494,12 @@ trait Trees extends api.Trees { self: SymbolTable =>
def TypeTree(tp: Type): TypeTree = TypeTree() setType tp
- class StrictTreeCopier extends TreeCopierOps {
+ override type TreeCopier <: InternalTreeCopierOps
+ abstract class InternalTreeCopierOps extends TreeCopierOps {
+ def ApplyDynamic(tree: Tree, qual: Tree, args: List[Tree]): ApplyDynamic
+ }
+
+ class StrictTreeCopier extends InternalTreeCopierOps {
def ClassDef(tree: Tree, mods: Modifiers, name: Name, tparams: List[TypeDef], impl: Template) =
new ClassDef(mods, name.toTypeName, tparams, impl).copyAttrs(tree)
def PackageDef(tree: Tree, pid: RefTree, stats: List[Tree]) =
@@ -590,7 +593,7 @@ trait Trees extends api.Trees { self: SymbolTable =>
new ExistentialTypeTree(tpt, whereClauses).copyAttrs(tree)
}
- class LazyTreeCopier extends TreeCopierOps {
+ class LazyTreeCopier extends InternalTreeCopierOps {
val treeCopy: TreeCopier = newStrictTreeCopier
def ClassDef(tree: Tree, mods: Modifiers, name: Name, tparams: List[TypeDef], impl: Template) = tree match {
case t @ ClassDef(mods0, name0, tparams0, impl0)
@@ -1585,7 +1588,6 @@ trait Trees extends api.Trees { self: SymbolTable =>
implicit val GenericApplyTag = ClassTag[GenericApply](classOf[GenericApply])
implicit val TypeApplyTag = ClassTag[TypeApply](classOf[TypeApply])
implicit val ApplyTag = ClassTag[Apply](classOf[Apply])
- implicit val ApplyDynamicTag = ClassTag[ApplyDynamic](classOf[ApplyDynamic])
implicit val SuperTag = ClassTag[Super](classOf[Super])
implicit val ThisTag = ClassTag[This](classOf[This])
implicit val SelectTag = ClassTag[Select](classOf[Select])
diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
index 1dae6e70b7..a9994a037f 100644
--- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
+++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
@@ -446,7 +446,7 @@ abstract class UnPickler /*extends scala.reflect.generic.UnPickler*/ {
private def readArrayAnnot() = {
readByte() // skip the `annotargarray` tag
val end = readNat() + readIndex
- until(end, () => readClassfileAnnotArg(readNat())).toArray(ClassfileAnnotArgTag)
+ until(end, () => readClassfileAnnotArg(readNat())).toArray(JavaArgumentTag)
}
protected def readClassfileAnnotArg(i: Int): ClassfileAnnotArg = bytes(index(i)) match {
case ANNOTINFO => NestedAnnotArg(at(i, readAnnotation))
diff --git a/src/reflect/scala/reflect/macros/Infrastructure.scala b/src/reflect/scala/reflect/macros/Infrastructure.scala
index f01725cd1d..80153ff257 100644
--- a/src/reflect/scala/reflect/macros/Infrastructure.scala
+++ b/src/reflect/scala/reflect/macros/Infrastructure.scala
@@ -43,7 +43,7 @@ trait Infrastructure {
* val importer = ru.mkImporter(c.universe).asInstanceOf[ru.Importer { val from: c.universe.type }]
* val tree = c.resetAllAttrs(x.tree.duplicate)
* val imported = importer.importTree(tree)
- * val valueOfX = toolBox.runExpr(imported).asInstanceOf[T]
+ * val valueOfX = toolBox.eval(imported).asInstanceOf[T]
* ...
* }
*/
@@ -77,23 +77,4 @@ trait Infrastructure {
/** Returns a macro definition which triggered this macro expansion.
*/
val currentMacro: Symbol
-
- // todo. redo caches as discussed on Reflecting Meeting 2012/03/29
- // https://docs.google.com/document/d/1oUZGQpdt2qwioTlJcSt8ZFQwVLTvpxn8xa67P8OGVpU/edit
-
- /** A cache shared by all invocations of all macros across all compilation runs.
- *
- * Needs to be used with extreme care, since memory leaks here will swiftly crash the presentation compiler.
- * For example, Scala IDE typically launches a compiler run on every edit action so there might be hundreds of runs per minute.
- */
- val globalCache: scala.collection.mutable.Map[Any, Any]
-
- /** A cache shared by all invocations of the same macro within a single compilation run.
- *
- * This cache is cleared automatically after a compilation run is completed or abandoned.
- * It is also specific to a particular macro definition.
- *
- * To share data between different macros and/or different compilation runs, use ``globalCache''.
- */
- val cache: scala.collection.mutable.Map[Any, Any]
}
diff --git a/src/reflect/scala/reflect/macros/Parsers.scala b/src/reflect/scala/reflect/macros/Parsers.scala
index ea87c5842e..1742d07b60 100644
--- a/src/reflect/scala/reflect/macros/Parsers.scala
+++ b/src/reflect/scala/reflect/macros/Parsers.scala
@@ -5,7 +5,7 @@ trait Parsers {
self: Context =>
/** .. */
- // todo. distinguish between `parseExpr` and `parse`
+ // todo. distinguish between `parse` and `parse`
def parse(code: String): Tree
/** Represents an error during parsing
diff --git a/src/reflect/scala/reflect/macros/Universe.scala b/src/reflect/scala/reflect/macros/Universe.scala
index 06428ee3fc..7fa2e7cbae 100644
--- a/src/reflect/scala/reflect/macros/Universe.scala
+++ b/src/reflect/scala/reflect/macros/Universe.scala
@@ -10,7 +10,7 @@ abstract class Universe extends scala.reflect.api.Universe {
def attachments: base.Attachments { type Pos = Position }
/** ... */
- def addAttachment(attachment: Any): AttachableApi.this.type
+ def updateAttachment[T: ClassTag](attachment: T): AttachableApi.this.type
/** ... */
def removeAttachment[T: ClassTag]: AttachableApi.this.type
@@ -32,7 +32,7 @@ abstract class Universe extends scala.reflect.api.Universe {
def setTypeSignature(tpe: Type): Symbol
- def setAnnotations(annots: AnnotationInfo*): Symbol
+ def setAnnotations(annots: Annotation*): Symbol
def setName(name: Name): Symbol
diff --git a/src/reflect/scala/reflect/runtime/JavaUniverse.scala b/src/reflect/scala/reflect/runtime/JavaUniverse.scala
index 77d65a7db2..1d875b10f1 100644
--- a/src/reflect/scala/reflect/runtime/JavaUniverse.scala
+++ b/src/reflect/scala/reflect/runtime/JavaUniverse.scala
@@ -16,7 +16,7 @@ class JavaUniverse extends internal.SymbolTable with ReflectSetup with runtime.S
def log(msg: => AnyRef): Unit = println(" [] "+msg)
- type TreeCopier = TreeCopierOps
+ type TreeCopier = InternalTreeCopierOps
def newStrictTreeCopier: TreeCopier = new StrictTreeCopier
def newLazyTreeCopier: TreeCopier = new LazyTreeCopier