aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypedTrees.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-05-22 16:38:04 +0200
committerMartin Odersky <odersky@gmail.com>2013-05-22 16:44:28 +0200
commit0ebdcc7ed2d2024d93ba7d24b88187d4c502eb4b (patch)
treee76375245f790a2606a70cda6c69c6bd70ca49a4 /src/dotty/tools/dotc/core/TypedTrees.scala
parent62fe4b6ec456b4878a642aa7e98886b0c9d4c9dd (diff)
downloaddotty-0ebdcc7ed2d2024d93ba7d24b88187d4c502eb4b.tar.gz
dotty-0ebdcc7ed2d2024d93ba7d24b88187d4c502eb4b.tar.bz2
dotty-0ebdcc7ed2d2024d93ba7d24b88187d4c502eb4b.zip
Added desugaring.
With various other small changes.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypedTrees.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypedTrees.scala23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/dotty/tools/dotc/core/TypedTrees.scala b/src/dotty/tools/dotc/core/TypedTrees.scala
index b564c0e2c..2ded92920 100644
--- a/src/dotty/tools/dotc/core/TypedTrees.scala
+++ b/src/dotty/tools/dotc/core/TypedTrees.scala
@@ -231,7 +231,7 @@ object TypedTrees {
// ------ Creating typed equivalents of trees that exist only in untyped form -------
/** A tree representing the same reference as the given type */
- def ref(tp: NamedType)(implicit ctx: Context): tpd.NameTree =
+ def ref(tp: NamedType)(implicit ctx: Context): NameTree =
if (tp.symbol.isStatic) Ident(tp)
else tp.prefix match {
case pre: TermRef => Select(ref(pre), tp)
@@ -276,7 +276,7 @@ object TypedTrees {
* the RHS of a method contains a class owned by the method, this would be
* an error.
*/
- def ModuleDef(sym: TermSymbol, body: List[Tree])(implicit ctx: Context): TempTrees = {
+ def ModuleDef(sym: TermSymbol, body: List[Tree])(implicit ctx: Context): tpd.TempTrees = {
val modcls = sym.moduleClass.asClass
val constr = DefDef(modcls.primaryConstructor.asTerm, EmptyTree)
val clsdef = ClassDef(modcls, Nil, constr, body)
@@ -318,25 +318,6 @@ object TypedTrees {
else sym
} else foldOver(sym, tree)
}
-
- /** Temporary class that results from translation of ModuleDefs
- * (and possibly other statements).
- * The contained trees will be integrated in enclosing Blocks or Templates
- */
- case class TempTrees(trees: List[Tree]) extends Tree {
- override def tpe: Type = unsupported("tpe")
- }
-
- /** Integrates nested TempTrees in given list of trees */
- def flatten(trees: List[Tree]): List[Tree] =
- if (trees exists isTempTrees)
- trees flatMap {
- case TempTrees(ts) => ts
- case t => t :: Nil
- }
- else trees
-
- private val isTempTrees: Tree => Boolean = (_.isInstanceOf[TempTrees])
}
import Trees._