Skip to content

Commit e83e894

Browse files
committed
Simplify logic in adapt
1 parent 6d8f373 commit e83e894

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,16 +1265,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
12651265

12661266
def adapt(tree: Tree, pt: Type, original: untpd.Tree = untpd.EmptyTree)(implicit ctx: Context) = /*>|>*/ track("adapt") /*<|<*/ {
12671267
/*>|>*/ ctx.traceIndented(i"adapting $tree of type ${tree.tpe} to $pt", typr, show = true) /*<|<*/ {
1268-
val isMethodCall =
1269-
tree.tpe.widen match {
1270-
case (_: MethodType) | (_: PolyType) if !tree.isDef =>
1271-
true
1272-
case _ =>
1273-
false
1274-
}
1275-
if (!isMethodCall) // Delay tvar interpolation in method calls until they're fully applied
1276-
interpolateUndetVars(tree, if (tree.isDef) tree.symbol else NoSymbol)
1277-
1268+
if (tree.isDef) interpolateUndetVars(tree, tree.symbol)
1269+
else if (!tree.tpe.isInstanceOf[MethodOrPoly]) interpolateUndetVars(tree, NoSymbol)
12781270
tree.overwriteType(tree.tpe.simplified)
12791271
adaptInterpolated(tree, pt, original)
12801272
}

0 commit comments

Comments
 (0)