diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-16 15:21:12 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-16 15:21:21 +0200 |
commit | 0eb2d76c467a53786ae6147c9c983c23ab0894c8 (patch) | |
tree | 44db7e49882c87f2906d6d21dca564c0d5407d38 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | bd45ecc06b04c3788d1ce706508eed5e0c50b50b (diff) | |
download | dotty-0eb2d76c467a53786ae6147c9c983c23ab0894c8.tar.gz dotty-0eb2d76c467a53786ae6147c9c983c23ab0894c8.tar.bz2 dotty-0eb2d76c467a53786ae6147c9c983c23ab0894c8.zip |
Proparage function result constrains when inferring parameter types
If an application has functions with implicit parameter types we need to be
more aggressive about propagating knowledge of the expected result type into
the constraint.
Fixes #1378.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 11a7b6753..13b6167b1 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -597,6 +597,13 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit untpd.TypeTree(defn.FunctionClass(args.length).typeRef), args :+ body), pt) else { val params = args.asInstanceOf[List[untpd.ValDef]] + + pt match { + case pt: TypeVar if untpd.isFunctionWithImplicitParamType(tree) => + isFullyDefined(pt, ForceDegree.noBottom) + case _ => + } + val (protoFormals, protoResult) = decomposeProtoFunction(pt, params.length) def refersTo(arg: untpd.Tree, param: untpd.ValDef): Boolean = arg match { |