diff --git a/tests/pos/i8963.scala b/tests/pos/i8963.scala new file mode 100644 index 000000000000..e8609acd6abc --- /dev/null +++ b/tests/pos/i8963.scala @@ -0,0 +1,21 @@ +type Numeric = Double | Int + +sealed trait VarValues[T, C <: VarValues[T,C]] { + this: C => + val arr: Array[T] +} +final case class VarDoubles(arr: Array[Double]) extends VarValues[Double, VarDoubles] +final case class VarInts(arr: Array[Int]) extends VarValues[Int, VarInts] +final case class VarStrs(arr: Array[String]) extends VarValues[String, VarStrs] + +def check7(a: VarValues[_,_], b: VarValues[_,_]): Unit = { + (a,b) match { + case (x:(VarDoubles|VarInts), y:(VarDoubles|VarInts)) => + val x0: Iterator[Numeric] = x.arr.iterator + val y0: Iterator[Numeric] = y.arr.iterator + val l0: Iterator[(Numeric, Numeric)] = x0.zip(y0) + val ll0: Iterator[(Numeric, Numeric)]#GroupedIterator[(Numeric, Numeric)] = x0.zip(y0).sliding(2,1) + ??? + case _ => ??? + } +} \ No newline at end of file diff --git a/tests/pos/i9228.scala b/tests/pos/i9228.scala new file mode 100644 index 000000000000..a875e79c8b17 --- /dev/null +++ b/tests/pos/i9228.scala @@ -0,0 +1,18 @@ +object ABug { + + class Graph { class Node } + + def ltol[O](tb: List[O]): List[O] = ??? + + def gtoll(using g: Graph): List[List[g.Node]] = ??? + + object graph extends Graph + import graph._ + given graph.type = graph + + val osq: List[List[Node]] = gtoll + + val r: List[List[Any ]] = ltol(gtoll) + val q: List[List[Node]] = ltol(gtoll) + +} \ No newline at end of file