aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-21 09:25:21 +0100
committerMartin Odersky <odersky@gmail.com>2016-12-21 09:25:21 +0100
commitcf4f773840ba3955b2907b04208b378d22d37651 (patch)
tree121ae2551e7131b023eb18a4e5e70950e07cefd3 /compiler/src/dotty/tools/dotc/transform
parent190ee9dce3851d752c5dbe1f10bd96d2c2d6642b (diff)
downloaddotty-cf4f773840ba3955b2907b04208b378d22d37651.tar.gz
dotty-cf4f773840ba3955b2907b04208b378d22d37651.tar.bz2
dotty-cf4f773840ba3955b2907b04208b378d22d37651.zip
Fiddling with widenening
Fixing two failures in stdlib having to do with widening. In both cases, a widenIfUnstable was required. One was widening too much, the other too little.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform')
-rw-r--r--compiler/src/dotty/tools/dotc/transform/ElimByName.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/transform/LiftTry.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala
index 192227261..71ced3175 100644
--- a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala
+++ b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala
@@ -71,7 +71,7 @@ class ElimByName extends MiniPhaseTransform with InfoTransformer { thisTransform
def transformArg(arg: Tree, formal: Type): Tree = formal.dealias match {
case formalExpr: ExprType =>
- val argType = arg.tpe.widen
+ val argType = arg.tpe.widenIfUnstable
val argFun = arg match {
case Apply(Select(qual, nme.apply), Nil)
if qual.tpe.derivesFrom(defn.FunctionClass(0)) && isPureExpr(qual) =>
diff --git a/compiler/src/dotty/tools/dotc/transform/LiftTry.scala b/compiler/src/dotty/tools/dotc/transform/LiftTry.scala
index 6a273b91e..d01195614 100644
--- a/compiler/src/dotty/tools/dotc/transform/LiftTry.scala
+++ b/compiler/src/dotty/tools/dotc/transform/LiftTry.scala
@@ -57,7 +57,7 @@ class LiftTry extends MiniPhase with IdentityDenotTransformer { thisTransform =>
ctx.debuglog(i"lifting tree at ${tree.pos}, current owner = ${ctx.owner}")
val fn = ctx.newSymbol(
ctx.owner, ctx.freshName("liftedTree").toTermName, Synthetic | Method,
- MethodType(Nil, tree.tpe), coord = tree.pos)
+ MethodType(Nil, tree.tpe.widenIfUnstable), coord = tree.pos)
tree.changeOwnerAfter(ctx.owner, fn, thisTransform)
Block(DefDef(fn, tree) :: Nil, ref(fn).appliedToNone)
}