File tree 1 file changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1484,11 +1484,15 @@ trait Applications extends Compatibility {
1484
1484
}
1485
1485
1486
1486
/** Drop any leading implicit parameter sections */
1487
- def stripImplicit (tp : Type )(using Context ): Type = tp match {
1487
+ def stripImplicit (tp : Type , wildcardOnly : Boolean = false )(using Context ): Type = tp match {
1488
1488
case mt : MethodType if mt.isImplicitMethod =>
1489
- stripImplicit(resultTypeApprox(mt))
1489
+ stripImplicit(resultTypeApprox(mt, wildcardOnly ))
1490
1490
case pt : PolyType =>
1491
- pt.derivedLambdaType(pt.paramNames, pt.paramInfos, stripImplicit(pt.resultType)).asInstanceOf [PolyType ].flatten
1491
+ pt.derivedLambdaType(pt.paramNames, pt.paramInfos,
1492
+ stripImplicit(pt.resultType, wildcardOnly = true ))
1493
+ // can't use dependent types sinc ethey refer can refer to type parameters
1494
+ // in `pt` that are not bound by the constraint. Test case is run/enrich-gentraversable.scala.
1495
+ .asInstanceOf [PolyType ].flatten
1492
1496
case _ =>
1493
1497
tp
1494
1498
}
You can’t perform that action at this time.
0 commit comments