File tree 1 file changed +1
-16
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -1479,22 +1479,7 @@ class Namer { typer: Typer =>
1479
1479
// This case applies if the closure result type contains uninstantiated
1480
1480
// type variables. In this case, constrain the closure result from below
1481
1481
// by the parameter-capture-avoiding type of the body.
1482
- val rhsType = typedAheadExpr(mdef.rhs, tpt.tpe).tpe
1483
-
1484
- // The following part is important since otherwise we might instantiate
1485
- // the closure result type with a plain functon type that refers
1486
- // to local parameters. An example where this happens in `dependent-closures.scala`
1487
- // If the code after `val rhsType` is commented out, this file fails pickling tests.
1488
- // AVOIDANCE TODO: Follow up why this happens, and whether there
1489
- // are better ways to achieve this. It would be good if we could get rid of this code.
1490
- // It seems at least partially redundant with the nesting level checking on TypeVar
1491
- // instantiation.
1492
- val hygienicType = TypeOps .avoid(rhsType, termParamss.flatten)
1493
- if (! hygienicType.isValueType || ! (hygienicType <:< tpt.tpe))
1494
- report.error(i " return type ${tpt.tpe} of lambda cannot be made hygienic; \n " +
1495
- i " it is not a supertype of the hygienic type $hygienicType" , mdef.srcPos)
1496
- // println(i"lifting $rhsType over $termParamss -> $hygienicType = ${tpt.tpe}")
1497
- // println(TypeComparer.explained { implicit ctx => hygienicType <:< tpt.tpe })
1482
+ typedAheadExpr(mdef.rhs, tpt.tpe).tpe
1498
1483
case _ =>
1499
1484
}
1500
1485
WildcardType
You can’t perform that action at this time.
0 commit comments