Skip to content

Commit 4800aec

Browse files
committed
Recursively interpolate bounds in interpolateWildcards
1 parent 4cf3a1a commit 4800aec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,9 @@ class Typer extends Namer
834834
case _ => untpd.TypeTree(tp)
835835
}
836836
def interpolateWildcards = new TypeMap {
837-
def apply(t: Type) = t match
838-
case WildcardType => newTypeVar(TypeBounds.empty)
839-
case WildcardType(bounds: TypeBounds) => newTypeVar(bounds)
837+
def apply(t: Type): Type = t match
838+
case WildcardType(bounds: TypeBounds) =>
839+
newTypeVar(apply(bounds.orElse(TypeBounds.empty)).bounds)
840840
case _ => mapOver(t)
841841
}
842842
pt.stripTypeVar.dealias match {

0 commit comments

Comments
 (0)