diff --git a/compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala b/compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala index 2bdb8aa130ce..79f3b6e56304 100644 --- a/compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala +++ b/compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala @@ -548,7 +548,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds, /** The uninstantiated typevars of this constraint */ def uninstVars: collection.Seq[TypeVar] = { - if (myUninstVars == null) { + if (myUninstVars == null || myUninstVars.exists(_.inst.exists)) { myUninstVars = new mutable.ArrayBuffer[TypeVar] boundsMap.foreachBinding { (poly, entries) => for (i <- 0 until paramCount(entries)) { diff --git a/tests/neg/i3470.scala b/tests/neg/i3470.scala new file mode 100644 index 000000000000..5b3088e2a008 --- /dev/null +++ b/tests/neg/i3470.scala @@ -0,0 +1,6 @@ +object Main { + abstract class Factory[T <: Int] { + def size: T + def create: Array[T] = Array.ofDim(size) // error: No ClassTag available + } +} diff --git a/tests/pos/i3544.scala b/tests/pos/i3544.scala new file mode 100644 index 000000000000..8a8b5fbc8a75 --- /dev/null +++ b/tests/pos/i3544.scala @@ -0,0 +1,6 @@ +object Test { + case class Tuple2K[F[_], G[_], A](f: F[A], g: G[A]) + + val p0: Tuple2K[[X] => Int, [X] => String, Any] = Tuple2K(1, "s") + p0 == Tuple2K(List(1), Option("s")) +}