Skip to content

Commit bbdef5e

Browse files
authored
Merge pull request #3726 from dotty-staging/fix-#3544
Fix #3544: Better cache invalidation of uninstVars
2 parents 691f868 + 2744447 commit bbdef5e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
548548

549549
/** The uninstantiated typevars of this constraint */
550550
def uninstVars: collection.Seq[TypeVar] = {
551-
if (myUninstVars == null) {
551+
if (myUninstVars == null || myUninstVars.exists(_.inst.exists)) {
552552
myUninstVars = new mutable.ArrayBuffer[TypeVar]
553553
boundsMap.foreachBinding { (poly, entries) =>
554554
for (i <- 0 until paramCount(entries)) {

tests/neg/i3470.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object Main {
2+
abstract class Factory[T <: Int] {
3+
def size: T
4+
def create: Array[T] = Array.ofDim(size) // error: No ClassTag available
5+
}
6+
}

tests/pos/i3544.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object Test {
2+
case class Tuple2K[F[_], G[_], A](f: F[A], g: G[A])
3+
4+
val p0: Tuple2K[[X] => Int, [X] => String, Any] = Tuple2K(1, "s")
5+
p0 == Tuple2K(List(1), Option("s"))
6+
}

0 commit comments

Comments
 (0)