Skip to content

Add regression tests for already fixed issues #11012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/pos/i8963.scala
Original file line number Diff line number Diff line change
@@ -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 _ => ???
}
}
18 changes: 18 additions & 0 deletions tests/pos/i9228.scala
Original file line number Diff line number Diff line change
@@ -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)

}