summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-03-23 16:36:37 +0100
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-03-23 18:27:58 +0100
commit0b565c0a808ba6213a41f82b318285855c6836f0 (patch)
tree674611029fc54899ee7e9ae8710287e3c11a71bb /src/compiler/scala/tools/nsc/ast/TreeDSL.scala
parent53d7b39c61de071c5cb35f9044c9dd9cac84715b (diff)
downloadscala-0b565c0a808ba6213a41f82b318285855c6836f0.tar.gz
scala-0b565c0a808ba6213a41f82b318285855c6836f0.tar.bz2
scala-0b565c0a808ba6213a41f82b318285855c6836f0.zip
splice in typed, dup'ed, trees for TRUE and FALSE
sharing trees is bad also, substing in untyped trees into typed outer trees is not good for your health
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/TreeDSL.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeDSL.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
index 0d19b781e2..8703de4e18 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
@@ -44,6 +44,11 @@ trait TreeDSL {
def NULL = LIT(null)
def UNIT = LIT(())
+ // for those preferring boring, predictable lives, without the thrills of tree-sharing
+ // (but with the perk of typed trees)
+ def TRUE_typed = LIT(true) setType ConstantType(Constant(true))
+ def FALSE_typed = LIT(false) setType ConstantType(Constant(false))
+
object WILD {
def empty = Ident(nme.WILDCARD)
def apply(tpe: Type) = Ident(nme.WILDCARD) setType tpe