File tree 2 files changed +19
-2
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -1473,7 +1473,17 @@ trait Applications extends Compatibility {
1473
1473
}
1474
1474
}
1475
1475
1476
- /** Drop any implicit parameter section */
1476
+ /** Drop any leading type or implicit parameter sections */
1477
+ def stripInferrable (tp : Type )(using Context ): Type = tp match {
1478
+ case mt : MethodType if mt.isImplicitMethod =>
1479
+ stripInferrable(resultTypeApprox(mt))
1480
+ case pt : PolyType =>
1481
+ stripInferrable(pt.resType)
1482
+ case _ =>
1483
+ tp
1484
+ }
1485
+
1486
+ /** Drop any leading implicit parameter sections */
1477
1487
def stripImplicit (tp : Type )(using Context ): Type = tp match {
1478
1488
case mt : MethodType if mt.isImplicitMethod =>
1479
1489
stripImplicit(resultTypeApprox(mt))
@@ -2042,7 +2052,7 @@ trait Applications extends Compatibility {
2042
2052
skip(alt.widen)
2043
2053
2044
2054
def resultIsMethod (tp : Type ): Boolean = tp.widen.stripPoly match
2045
- case tp : MethodType => stripImplicit (tp.resultType).isInstanceOf [MethodType ]
2055
+ case tp : MethodType => stripInferrable (tp.resultType).isInstanceOf [MethodType ]
2046
2056
case _ => false
2047
2057
2048
2058
record(" resolveOverloaded.narrowedApplicable" , candidates.length)
Original file line number Diff line number Diff line change
1
+
2
+ class Foo
3
+
4
+ extension (dfVal : Foo )
5
+ def prevErr [T ](step : Int ): Foo = ???
6
+ def prevErr [T ]: Foo = ???
7
+ val err = (new Foo ).prevErr
You can’t perform that action at this time.
0 commit comments