File tree 1 file changed +4
-3
lines changed
src/dotty/tools/dotc/typer 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1462,14 +1462,15 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1462
1462
val arity =
1463
1463
if (defn.isFunctionType(pt))
1464
1464
if (! isFullyDefined(pt, ForceDegree .none) && isFullyDefined(wtp, ForceDegree .none))
1465
- // prioritize method parameter types over expected types as parameter types of the eta-expanded closure
1465
+ // if method type is fully defined, but expected type is not,
1466
+ // prioritize method parameter types as parameter types of the eta-expanded closure
1466
1467
0
1467
1468
else defn.functionArity(pt)
1468
1469
else if (pt eq AnyFunctionProto ) wtp.paramTypes.length
1469
1470
else - 1
1470
- if (arity >= 0 && ! tree.symbol.isConstructor) {
1471
+ if (arity >= 0 && ! tree.symbol.isConstructor)
1471
1472
typed(etaExpand(tree, wtp, arity), pt)
1472
- } else if (wtp.paramTypes.isEmpty)
1473
+ else if (wtp.paramTypes.isEmpty)
1473
1474
adaptInterpolated(tpd.Apply (tree, Nil ), pt, EmptyTree )
1474
1475
else if (wtp.isImplicit)
1475
1476
err.typeMismatch(tree, pt)
You can’t perform that action at this time.
0 commit comments