diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-03-23 16:36:37 +0100 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-03-23 18:27:58 +0100 |
commit | 0b565c0a808ba6213a41f82b318285855c6836f0 (patch) | |
tree | 674611029fc54899ee7e9ae8710287e3c11a71bb /src/compiler/scala/tools/nsc/ast/TreeDSL.scala | |
parent | 53d7b39c61de071c5cb35f9044c9dd9cac84715b (diff) | |
download | scala-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.scala | 5 |
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 |