summaryrefslogtreecommitdiff
path: root/src/reflect/scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-19 13:01:40 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-19 13:01:40 +0200
commit3c542251e04cd85903ec12f5747c86d5c6c1a867 (patch)
treea343444eeb77f882e9dca37b05edc7d91afaca59 /src/reflect/scala
parenteb49e8176f334eebc77072cc9334c7f1875b09a2 (diff)
downloadscala-3c542251e04cd85903ec12f5747c86d5c6c1a867.tar.gz
scala-3c542251e04cd85903ec12f5747c86d5c6c1a867.tar.bz2
scala-3c542251e04cd85903ec12f5747c86d5c6c1a867.zip
SI-6390 removes Trees#ArrayValue from the API
Introduced by uncurry - therefore it can be seen neither by macros, nor by runtime reflection. Despite never being pickled, ArrayValue is supported by unpickler so I couldn't move it exclusively to scala-compiler.jar. Figuring out the mysterious reason for pickling ArrayValue is left to future work.
Diffstat (limited to 'src/reflect/scala')
-rw-r--r--src/reflect/scala/reflect/api/Trees.scala9
-rw-r--r--src/reflect/scala/reflect/internal/Trees.scala22
2 files changed, 18 insertions, 13 deletions
diff --git a/src/reflect/scala/reflect/api/Trees.scala b/src/reflect/scala/reflect/api/Trees.scala
index e46a977be8..18d960ae04 100644
--- a/src/reflect/scala/reflect/api/Trees.scala
+++ b/src/reflect/scala/reflect/api/Trees.scala
@@ -317,14 +317,6 @@ trait Trees extends base.Trees { self: Universe =>
val args: List[Tree]
}
- override type ArrayValue >: Null <: TermTree with ArrayValueApi
-
- /** The API that all array values support */
- trait ArrayValueApi extends TermTreeApi { this: ArrayValue =>
- val elemtpt: Tree
- val elems: List[Tree]
- }
-
override type Function >: Null <: TermTree with SymTree with FunctionApi
/** The API that all functions support */
@@ -565,7 +557,6 @@ trait Trees extends base.Trees { self: Universe =>
def Star(tree: Tree, elem: Tree): Star
def Bind(tree: Tree, name: Name, body: Tree): Bind
def UnApply(tree: Tree, fun: Tree, args: List[Tree]): UnApply
- def ArrayValue(tree: Tree, elemtpt: Tree, trees: List[Tree]): ArrayValue
def Function(tree: Tree, vparams: List[ValDef], body: Tree): Function
def Assign(tree: Tree, lhs: Tree, rhs: Tree): Assign
def AssignOrNamedArg(tree: Tree, lhs: Tree, rhs: Tree): AssignOrNamedArg
diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala
index 5a6d6ce7c7..8e91431220 100644
--- a/src/reflect/scala/reflect/internal/Trees.scala
+++ b/src/reflect/scala/reflect/internal/Trees.scala
@@ -328,9 +328,23 @@ trait Trees extends api.Trees { self: SymbolTable =>
extends TermTree with UnApplyApi
object UnApply extends UnApplyExtractor
- case class ArrayValue(elemtpt: Tree, elems: List[Tree])
- extends TermTree with ArrayValueApi
- object ArrayValue extends ArrayValueExtractor
+ /** An array of expressions. This AST node needs to be translated in backend.
+ * It is used to pass arguments to vararg arguments.
+ * Introduced by compiler phase uncurry.
+ *
+ * This AST node does not have direct correspondence to Scala code,
+ * and is used to pass arguments to vararg arguments. For instance:
+ *
+ * printf("%s%d", foo, 42)
+ *
+ * Is translated to after compiler phase uncurry to:
+ *
+ * Apply(
+ * Ident("printf"),
+ * Literal("%s%d"),
+ * ArrayValue(<Any>, List(Ident("foo"), Literal(42))))
+ */
+ case class ArrayValue(elemtpt: Tree, elems: List[Tree]) extends TermTree
case class Function(vparams: List[ValDef], body: Tree)
extends SymTree with TermTree with FunctionApi
@@ -497,6 +511,7 @@ trait Trees extends api.Trees { self: SymbolTable =>
override type TreeCopier <: InternalTreeCopierOps
abstract class InternalTreeCopierOps extends TreeCopierOps {
def ApplyDynamic(tree: Tree, qual: Tree, args: List[Tree]): ApplyDynamic
+ def ArrayValue(tree: Tree, elemtpt: Tree, trees: List[Tree]): ArrayValue
}
class StrictTreeCopier extends InternalTreeCopierOps {
@@ -1574,7 +1589,6 @@ trait Trees extends api.Trees { self: SymbolTable =>
implicit val StarTag = ClassTag[Star](classOf[Star])
implicit val BindTag = ClassTag[Bind](classOf[Bind])
implicit val UnApplyTag = ClassTag[UnApply](classOf[UnApply])
- implicit val ArrayValueTag = ClassTag[ArrayValue](classOf[ArrayValue])
implicit val FunctionTag = ClassTag[Function](classOf[Function])
implicit val AssignTag = ClassTag[Assign](classOf[Assign])
implicit val AssignOrNamedArgTag = ClassTag[AssignOrNamedArg](classOf[AssignOrNamedArg])