@@ -1321,18 +1321,18 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
1321
1321
case tp : TypeParamRef =>
1322
1322
decomposeProtoFunction(ctx.typerState.constraint.entry(tp).bounds.hi, defaultArity, pos)
1323
1323
case _ => pt1.findFunctionType match {
1324
- case ft @ defn.PolyFunctionOf (mt @ MethodTpe (_, formals, restpe)) =>
1325
- if formals.length != defaultArity then fallbackProto
1326
- else (formals, untpd.InLambdaTypeTree (isResult = true , (_, syms) => restpe.substParams(mt, syms.map(_.termRef))))
1327
- case ft @ defn.DependentFunctionRefinementOf (_, mt @ MethodTpe (_, formals, restpe)) =>
1328
- if formals.length != defaultArity then fallbackProto
1329
- else (formals, untpd.InLambdaTypeTree (isResult = true , (_, syms) => restpe.substParams(mt, syms.map(_.termRef))))
1330
1324
case ft @ defn.FunctionNOf (_, _, _) =>
1331
1325
// if expected parameter type(s) are wildcards, approximate from below.
1332
1326
// if expected result type is a wildcard, approximate from above.
1333
1327
// this can type the greatest set of admissible closures.
1334
1328
1335
1329
(ft.argInfos.init, typeTree(interpolateWildcards(ft.argInfos.last.hiBound)))
1330
+ case ft @ defn.PolyFunctionOf (mt @ MethodTpe (_, formals, restpe)) =>
1331
+ if formals.length != defaultArity then fallbackProto
1332
+ else (formals, untpd.InLambdaTypeTree (isResult = true , (_, syms) => restpe.substParams(mt, syms.map(_.termRef))))
1333
+ case ft @ defn.DependentFunctionRefinementOf (_, mt @ MethodTpe (_, formals, restpe)) =>
1334
+ if formals.length != defaultArity then fallbackProto
1335
+ else (formals, untpd.InLambdaTypeTree (isResult = true , (_, syms) => restpe.substParams(mt, syms.map(_.termRef))))
1336
1336
case SAMType (mt @ MethodTpe (_, formals, _), samParent) =>
1337
1337
val restpe = mt.resultType match
1338
1338
case mt : MethodType => mt.toFunctionType(isJava = samParent.classSymbol.is(JavaDefined ))
0 commit comments