Skip to content

Commit b04150c

Browse files
committed
Add test about F-Bounds
1 parent ccc0258 commit b04150c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/pos/i9740c.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sealed trait Exp[T]
2+
case class IntExp(x: Int) extends Exp[Int]
3+
case class StrExp(x: String) extends Exp[String]
4+
object UnitExp extends Exp[Unit]
5+
6+
trait Txn[T <: Txn[T]]
7+
case class Obj(o: AnyRef) extends Txn[Obj] with Exp[AnyRef]
8+
9+
10+
class Foo {
11+
def bar[A <: Txn[A]](x: Exp[A]): Unit = x match
12+
case IntExp(x) =>
13+
case StrExp(x) =>
14+
case UnitExp =>
15+
case Obj(o) =>
16+
}

0 commit comments

Comments
 (0)