Skip to content

Commit

Permalink
Merge pull request #13742 from dotty-staging/less-constrainResult
Browse files Browse the repository at this point in the history
Remove unnecessary call to constrainResult
  • Loading branch information
odersky committed Nov 3, 2021
2 parents 8ee672c + fccae2b commit 9153fe5
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -891,15 +891,6 @@ trait Applications extends Compatibility {
then originalProto.tupledDual
else originalProto

// If some of the application's arguments are function literals without explicitly declared
// 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(tree.symbol, fun1.tpe.widen, proto.derivedFunProto(resultType = pt)))
typr.println(i"result failure for $tree with type ${fun1.tpe.widen}, expected = $pt")

/** Type application where arguments come from prototype, and no implicits are inserted */
def simpleApply(fun1: Tree, proto: FunProto)(using Context): Tree =
methPart(fun1).tpe match {
Expand Down

0 comments on commit 9153fe5

Please sign in to comment.