Skip to content

Commit 261dd4b

Browse files
committed
Add regression tests for already fixed issues
Fixes #9228 Fixes #8963
1 parent 0dc824c commit 261dd4b

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

tests/pos/i8963.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
type Numeric = Double | Int
2+
3+
sealed trait VarValues[T, C <: VarValues[T,C]] {
4+
this: C =>
5+
val arr: Array[T]
6+
}
7+
final case class VarDoubles(arr: Array[Double]) extends VarValues[Double, VarDoubles]
8+
final case class VarInts(arr: Array[Int]) extends VarValues[Int, VarInts]
9+
final case class VarStrs(arr: Array[String]) extends VarValues[String, VarStrs]
10+
11+
def check7(a: VarValues[_,_], b: VarValues[_,_]): Unit = {
12+
(a,b) match {
13+
case (x:(VarDoubles|VarInts), y:(VarDoubles|VarInts)) =>
14+
val x0: Iterator[Numeric] = x.arr.iterator
15+
val y0: Iterator[Numeric] = y.arr.iterator
16+
val l0: Iterator[(Numeric, Numeric)] = x0.zip(y0)
17+
val ll0: Iterator[(Numeric, Numeric)]#GroupedIterator[(Numeric, Numeric)] = x0.zip(y0).sliding(2,1)
18+
???
19+
case _ => ???
20+
}
21+
}

tests/pos/i9228.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
object ABug {
2+
3+
class Graph { class Node }
4+
5+
def ltol[O](tb: List[O]): List[O] = ???
6+
7+
def gtoll(using g: Graph): List[List[g.Node]] = ???
8+
9+
object graph extends Graph
10+
import graph._
11+
given graph.type = graph
12+
13+
val osq: List[List[Node]] = gtoll
14+
15+
val r: List[List[Any ]] = ltol(gtoll)
16+
val q: List[List[Node]] = ltol(gtoll)
17+
18+
}

0 commit comments

Comments
 (0)