Skip to content

Commit 4cf3a1a

Browse files
committed
Replace wildcard types by TypeVars in decomposeProto
Approximating wildcard types loses too much information. it's better to replace them by fresh typevars instead.
1 parent 35b05c5 commit 4cf3a1a

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
@@ -833,10 +833,10 @@ class Typer extends Namer
833833
case _: WildcardType => untpd.TypeTree()
834834
case _ => untpd.TypeTree(tp)
835835
}
836-
def interpolateWildcards = new ApproximatingTypeMap {
836+
def interpolateWildcards = new TypeMap {
837837
def apply(t: Type) = t match
838-
case WildcardType => emptyRange
839-
case WildcardType(bounds: TypeBounds) => range(bounds.lo, bounds.hi)
838+
case WildcardType => newTypeVar(TypeBounds.empty)
839+
case WildcardType(bounds: TypeBounds) => newTypeVar(bounds)
840840
case _ => mapOver(t)
841841
}
842842
pt.stripTypeVar.dealias match {

0 commit comments

Comments
 (0)