File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -582,7 +582,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
582
582
583
583
private def decomposeProtoFunction (pt : Type , defaultArity : Int )(implicit ctx : Context ): (List [Type ], Type ) = pt match {
584
584
case _ if defn.isFunctionType(pt) =>
585
- (pt.dealias.argInfos.init, pt.dealias.argInfos.last)
585
+ // if expected parameter type(s) are wildcards, approximate from below.
586
+ // if expected result type is a wildcard, approximate from above.
587
+ // this can type the greatest set of admissible closures.
588
+ (pt.dealias.argTypesLo.init, pt.dealias.argTypesHi.last)
586
589
case SAMType (meth) =>
587
590
val mt @ MethodType (_, paramTypes) = meth.info
588
591
(paramTypes, mt.resultType)
You can’t perform that action at this time.
0 commit comments