diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-09-14 13:49:18 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-09-14 20:55:40 +0200 |
commit | db306cb526b941ed30613d9acf1c0958dd1405f7 (patch) | |
tree | 3366d43ee574c41865f810d27c45e82ad91079e5 /src/reflect | |
parent | 83c1b1062957e50e5336c1b3409e54e0a5cce275 (diff) | |
download | scala-db306cb526b941ed30613d9acf1c0958dd1405f7.tar.gz scala-db306cb526b941ed30613d9acf1c0958dd1405f7.tar.bz2 scala-db306cb526b941ed30613d9acf1c0958dd1405f7.zip |
SI-6373 removes Trees#ApplyDynamic from the API
Introduced by erasure - therefore it can be seen
neither by macros, nor by runtime reflection.
Despite never being pickled, ApplyDynamic is supported by unpickler
so I couldn't move it exclusively to scala-compiler.jar.
Figuring out the mysterious reason for pickling ApplyDynamic is left
to future work.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/api/Trees.scala | 9 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Trees.scala | 14 | ||||
-rw-r--r-- | src/reflect/scala/reflect/runtime/JavaUniverse.scala | 2 |
3 files changed, 9 insertions, 16 deletions
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/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/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 |