Skip to content

Commit 881d6dd

Browse files
committed
Add tests
1 parent 364a114 commit 881d6dd

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

tests/patmat/i9631.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
trait Txn[T <: Txn[T]]
2+
3+
sealed trait SkipList[T <: Txn[T]]
4+
5+
trait Set[T <: Txn[T]] extends SkipList[T]
6+
7+
object HASkipList {
8+
def debug[T <: Txn[T]](in: SkipList[T]): Set[T] = in match {
9+
case impl: Set[T] => impl
10+
// case _ =>
11+
}
12+
}

tests/pos/i9631.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
trait Txn[T <: Txn[T]]
2+
3+
object SkipList {
4+
trait Set[T <: Txn[T], A] extends SkipList[T, A, A]
5+
}
6+
sealed trait SkipList[T <: Txn[T], A, E]
7+
8+
object HASkipList {
9+
def debug[T <: Txn[T], A](in: SkipList[T, A, _], key: A)(implicit tx: T): Int = in match {
10+
case impl: Impl[T, A, _] => impl.foo(key)
11+
case _ => -1
12+
}
13+
14+
private trait Impl[T <: Txn[T], A, E] {
15+
self: SkipList[T, A, E] =>
16+
17+
def foo(key: A)(implicit tx: T): Int
18+
}
19+
}

0 commit comments

Comments
 (0)