Skip to content

Commit 0b252fa

Browse files
committed
Fix variance in avoidParams
Need to avoid variance 0, as it leads to leaking ranges.
1 parent ac19a03 commit 0b252fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/TypeApplications.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import NameKinds._
1515
import Flags._
1616
import StdNames.tpnme
1717
import util.Positions.Position
18-
import config.Printers.core
18+
import config.Printers.{core, typr}
1919
import collection.mutable
2020
import dotty.tools.dotc.config.Config
2121
import java.util.NoSuchElementException
@@ -423,7 +423,7 @@ class TypeApplications(val self: Type) extends AnyVal {
423423
case TypeBounds(lo, hi) =>
424424
val v = tparam.paramVariance
425425
val avoidParams = new ApproximatingTypeMap {
426-
variance = v
426+
variance = if (v >= 0) 1 else -1
427427
def apply(t: Type) = t match {
428428
case t: TypeRef if typParams contains t.symbol =>
429429
val bounds = apply(t.info).bounds

0 commit comments

Comments
 (0)