File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 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 {
14841484 }
14851485
14861486 /** 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 {
14881488 case mt : MethodType if mt.isImplicitMethod =>
1489- stripImplicit(resultTypeApprox(mt))
1489+ stripImplicit(resultTypeApprox(mt, wildcardOnly ))
14901490 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
14921496 case _ =>
14931497 tp
14941498 }
You can’t perform that action at this time.
0 commit comments