aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/TypeUtils.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-07-18 16:42:07 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-07-22 14:06:01 +0200
commit068fc8e088dab2aca98b72ba07ef44edbd94953b (patch)
treef44ae1ea6f471de49ca854bdb022a4d1c960a9ee /src/dotty/tools/dotc/transform/TypeUtils.scala
parentde2ecc7fd7f7936bc19c6f3cb264ef6d94b01794 (diff)
downloaddotty-068fc8e088dab2aca98b72ba07ef44edbd94953b.tar.gz
dotty-068fc8e088dab2aca98b72ba07ef44edbd94953b.tar.bz2
dotty-068fc8e088dab2aca98b72ba07ef44edbd94953b.zip
Create RetypingTreeMap that propagates types
If some node in tree is transformed changing the type, the outer node could potentially also change type. This patch implements a RetypingTreeMap that propagates those changes until types converge. Propagation is done for tree nodes that are able to compute their type based on their children: Pair, Block, If, Match, CaseDef, Try, SeqLiteral, Annotated, Select.
Diffstat (limited to 'src/dotty/tools/dotc/transform/TypeUtils.scala')
-rw-r--r--src/dotty/tools/dotc/transform/TypeUtils.scala13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/transform/TypeUtils.scala b/src/dotty/tools/dotc/transform/TypeUtils.scala
index f11bb980a..a26660092 100644
--- a/src/dotty/tools/dotc/transform/TypeUtils.scala
+++ b/src/dotty/tools/dotc/transform/TypeUtils.scala
@@ -1,23 +1,18 @@
package dotty.tools.dotc
package transform
-import core._
-import Types._
-import Contexts._
-import Symbols._
-import Decorators._
-import StdNames.nme
-import NameOps._
-import language.implicitConversions
+import dotty.tools.dotc.core.Types._
+
+import scala.language.implicitConversions
object TypeUtils {
implicit def decorateTypeUtils(tpe: Type): TypeUtils = new TypeUtils(tpe)
+
}
/** A decorator that provides methods for type transformations
* that are needed in the transofmer pipeline (not needed right now)
*/
class TypeUtils(val self: Type) extends AnyVal {
- import TypeUtils._
} \ No newline at end of file