Skip to content

Commit df94b5b

Browse files
committed
better bounds for wildcards in resultTypeApprox
1 parent 8644b4b commit df94b5b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,10 @@ object ProtoTypes {
707707
if wildcardOnly
708708
|| ctx.mode.is(Mode.TypevarsMissContext)
709709
|| !ref.underlying.widenExpr.isValueTypeOrWildcard
710-
then WildcardType
711-
else newDepTypeVar(ref)
710+
then
711+
WildcardType(ref.underlying.substParams(mt, mt.paramRefs.map(_ => WildcardType)).toBounds)
712+
else
713+
newDepTypeVar(ref)
712714
mt.resultType.substParams(mt, mt.paramRefs.map(replacement))
713715
else mt.resultType
714716

0 commit comments

Comments
 (0)