diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-07-18 16:42:07 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-07-22 14:06:01 +0200 |
commit | 068fc8e088dab2aca98b72ba07ef44edbd94953b (patch) | |
tree | f44ae1ea6f471de49ca854bdb022a4d1c960a9ee /src/dotty/tools/dotc/transform/TypeUtils.scala | |
parent | de2ecc7fd7f7936bc19c6f3cb264ef6d94b01794 (diff) | |
download | dotty-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.scala | 13 |
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 |