File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ object Implicits {
52
52
mt.paramTypes.length != 1 ||
53
53
! (argType relaxed_<:< mt.paramTypes.head)(ctx.fresh.setExploreTyperState)
54
54
case poly : PolyType =>
55
+ // We do not need to call ProtoTypes#constrained on `poly` because
56
+ // `refMatches` is always called with mode TypevarsMissContext enabled.
55
57
poly.resultType match {
56
58
case mt : MethodType =>
57
59
mt.isImplicit ||
Original file line number Diff line number Diff line change @@ -391,11 +391,15 @@ object ProtoTypes {
391
391
case tp : TypeAlias => // default case, inlined for speed
392
392
tp.derivedTypeAlias(wildApprox(tp.alias, theMap))
393
393
case tp @ PolyParam (poly, pnum) =>
394
- ctx.typerState.constraint.entry(tp) match {
395
- case bounds : TypeBounds => wildApprox(WildcardType (bounds))
396
- case NoType => WildcardType (wildApprox(poly.paramBounds(pnum)).bounds)
397
- case inst => wildApprox(inst)
398
- }
394
+ def unconstrainedApprox = WildcardType (wildApprox(poly.paramBounds(pnum)).bounds)
395
+ if (ctx.mode.is(Mode .TypevarsMissContext ))
396
+ unconstrainedApprox
397
+ else
398
+ ctx.typerState.constraint.entry(tp) match {
399
+ case bounds : TypeBounds => wildApprox(WildcardType (bounds))
400
+ case NoType => unconstrainedApprox
401
+ case inst => wildApprox(inst)
402
+ }
399
403
case MethodParam (mt, pnum) =>
400
404
WildcardType (TypeBounds .upper(wildApprox(mt.paramTypes(pnum))))
401
405
case tp : TypeVar =>
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ val x = ??? .getClass.getMethods.head.getParameterTypes.mkString(" ," )
3
+ }
You can’t perform that action at this time.
0 commit comments