aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-07-17 11:05:23 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-17 11:05:23 +0200
commit9d66f8688291cb59ad78784d792dcf28a5527142 (patch)
tree8d6283fd1ac1befa48641990841a0097ae46d73c /src/dotty/tools/dotc/typer/Applications.scala
parent0eb2d76c467a53786ae6147c9c983c23ab0894c8 (diff)
downloaddotty-9d66f8688291cb59ad78784d792dcf28a5527142.tar.gz
dotty-9d66f8688291cb59ad78784d792dcf28a5527142.tar.bz2
dotty-9d66f8688291cb59ad78784d792dcf28a5527142.zip
Adress reviewers comments
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 7a742112b..56183d2ff 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -554,12 +554,11 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
if (proto.isTupled) proto = proto.tupled
// If some of the application's arguments are function literals without explicitly declared
- // parameter types, and the expected type is a value type, relate the
- // normalized result type of the application with the expected type through `<:<`.
- // This can add more constraints which help sharpen the inferred parameter
- // types for the argument function literal(s).
- // This tweak is needed to make i1348 compile.
- if (tree.args.exists(untpd.isFunctionWithImplicitParamType(_)))
+ // parameter types, relate the normalized result type of the application with the
+ // expected type through `constrainResult`. This can add more constraints which
+ // help sharpen the inferred parameter types for the argument function literal(s).
+ // This tweak is needed to make i1378 compile.
+ if (tree.args.exists(untpd.isFunctionWithUnknownParamType(_)))
if (!constrainResult(fun1.tpe.widen, proto.derivedFunProto(resultType = pt)))
typr.println(i"result failure for $tree with type ${fun1.tpe.widen}, expected = $pt")