@@ -1320,16 +1320,15 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
1320
1320
case tp : TypeParamRef =>
1321
1321
decomposeProtoFunction(ctx.typerState.constraint.entry(tp).bounds.hi, defaultArity, pos)
1322
1322
case _ => pt1.findFunctionType match {
1323
- case pt1 if defn.isNonRefinedFunction(pt1 ) =>
1323
+ case ft if defn.isNonRefinedFunction(ft ) =>
1324
1324
// if expected parameter type(s) are wildcards, approximate from below.
1325
1325
// if expected result type is a wildcard, approximate from above.
1326
1326
// this can type the greatest set of admissible closures.
1327
1327
1328
- (pt1.argInfos.init, typeTree(interpolateWildcards(pt1.argInfos.last.hiBound)))
1329
- case RefinedType (parent, nme.apply, mt @ MethodTpe (_, formals, restpe))
1330
- if defn.isNonRefinedFunction(parent) && formals.length == defaultArity =>
1331
- (formals, untpd.InLambdaTypeTree (isResult = true , (_, syms) => restpe.substParams(mt, syms.map(_.termRef))))
1332
- case defn.PolyFunctionOf (mt @ MethodTpe (_, formals, restpe)) if formals.length == defaultArity =>
1328
+ (ft.argInfos.init, typeTree(interpolateWildcards(ft.argInfos.last.hiBound)))
1329
+ case ft @ RefinedType (parent, nme.apply, mt @ MethodTpe (_, formals, restpe))
1330
+ if defn.isFunctionType(ft) && formals.length == defaultArity =>
1331
+ // PolyFunction or dependent refinement
1333
1332
(formals, untpd.InLambdaTypeTree (isResult = true , (_, syms) => restpe.substParams(mt, syms.map(_.termRef))))
1334
1333
case SAMType (mt @ MethodTpe (_, formals, _), samParent) =>
1335
1334
val restpe = mt.resultType match
0 commit comments