aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-10-25 15:14:49 +0100
committerMartin Odersky <odersky@gmail.com>2015-10-25 15:14:49 +0100
commite83e8944c5757d4b60de796a505925fa2f1bb4f7 (patch)
tree832b0d6688db2390e2bc3324532fdcac4a80e8f5 /src/dotty/tools/dotc/typer/Typer.scala
parent6d8f3730ca4d381b105737edaff6f8794b54e848 (diff)
downloaddotty-e83e8944c5757d4b60de796a505925fa2f1bb4f7.tar.gz
dotty-e83e8944c5757d4b60de796a505925fa2f1bb4f7.tar.bz2
dotty-e83e8944c5757d4b60de796a505925fa2f1bb4f7.zip
Simplify logic in adapt
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 47cd1cd18..e0a1c502c 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1265,16 +1265,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
def adapt(tree: Tree, pt: Type, original: untpd.Tree = untpd.EmptyTree)(implicit ctx: Context) = /*>|>*/ track("adapt") /*<|<*/ {
/*>|>*/ ctx.traceIndented(i"adapting $tree of type ${tree.tpe} to $pt", typr, show = true) /*<|<*/ {
- val isMethodCall =
- tree.tpe.widen match {
- case (_: MethodType) | (_: PolyType) if !tree.isDef =>
- true
- case _ =>
- false
- }
- if (!isMethodCall) // Delay tvar interpolation in method calls until they're fully applied
- interpolateUndetVars(tree, if (tree.isDef) tree.symbol else NoSymbol)
-
+ if (tree.isDef) interpolateUndetVars(tree, tree.symbol)
+ else if (!tree.tpe.isInstanceOf[MethodOrPoly]) interpolateUndetVars(tree, NoSymbol)
tree.overwriteType(tree.tpe.simplified)
adaptInterpolated(tree, pt, original)
}