summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/library/scala/reflect/base/Base.scala5
-rw-r--r--src/library/scala/reflect/base/Trees.scala42
-rw-r--r--src/reflect/scala/reflect/api/Trees.scala9
-rw-r--r--src/reflect/scala/reflect/internal/Trees.scala22
4 files changed, 23 insertions, 55 deletions
diff --git a/src/library/scala/reflect/base/Base.scala b/src/library/scala/reflect/base/Base.scala
index 6ecfd384ab..7cbc39a3b6 100644
--- a/src/library/scala/reflect/base/Base.scala
+++ b/src/library/scala/reflect/base/Base.scala
@@ -571,10 +571,6 @@ class Base extends Universe { self =>
extends TermTree
object UnApply extends UnApplyExtractor
- case class ArrayValue(elemtpt: Tree, elems: List[Tree])
- extends TermTree
- object ArrayValue extends ArrayValueExtractor
-
case class Function(vparams: List[ValDef], body: Tree)
extends TermTree with SymTree
object Function extends FunctionExtractor
@@ -711,7 +707,6 @@ class Base extends Universe { self =>
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])
diff --git a/src/library/scala/reflect/base/Trees.scala b/src/library/scala/reflect/base/Trees.scala
index 428b493478..6931d23173 100644
--- a/src/library/scala/reflect/base/Trees.scala
+++ b/src/library/scala/reflect/base/Trees.scala
@@ -538,7 +538,7 @@ trait Trees { self: Universe =>
}
/** Alternatives of patterns.
- *
+ *
* Eliminated by compiler phases Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher),
* except for
* occurrences in encoded Switch stmt (i.e. remaining Match(CaseDef(...)))
@@ -564,7 +564,7 @@ trait Trees { self: Universe =>
}
/** Repetition of pattern.
- *
+ *
* Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher).
*/
type Star >: Null <: TermTree
@@ -588,7 +588,7 @@ trait Trees { self: Universe =>
}
/** Bind a variable to a rhs pattern.
- *
+ *
* Eliminated by compiler phases patmat (in the new pattern matcher of 2.10) or explicitouter (in the old pre-2.10 pattern matcher).
*
* @param name
@@ -614,7 +614,7 @@ trait Trees { self: Universe =>
def unapply(bind: Bind): Option[(Name, Tree)]
}
- /**
+ /**
* Used to represent `unapply` methods in pattern matching.
*
* For example:
@@ -660,38 +660,6 @@ trait Trees { self: Universe =>
def unapply(unApply: UnApply): Option[(Tree, List[Tree])]
}
- /** 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.
- */
- type ArrayValue >: Null <: TermTree
-
- /** A tag that preserves the identity of the `ArrayValue` abstract type from erasure.
- * Can be used for pattern matching, instance tests, serialization and likes.
- */
- implicit val ArrayValueTag: ClassTag[ArrayValue]
-
- /** The constructor/deconstructor for `ArrayValue` instances. */
- val ArrayValue: ArrayValueExtractor
-
- /** An extractor class to create and pattern match with syntax `ArrayValue(elemtpt, elems)`.
- * 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))))
- */
- abstract class ArrayValueExtractor {
- def apply(elemtpt: Tree, elems: List[Tree]): ArrayValue
- def unapply(arrayValue: ArrayValue): Option[(Tree, List[Tree])]
- }
-
/** Anonymous function, eliminated by compiler phase lambdalift */
type Function >: Null <: TermTree with SymTree
@@ -705,7 +673,7 @@ trait Trees { self: Universe =>
/** An extractor class to create and pattern match with syntax `Function(vparams, body)`.
* This AST node corresponds to the following Scala code:
- *
+ *
* vparams => body
*
* The symbol of a Function is a synthetic TermSymbol.
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])