Skip to content

Commit 00ee7e2

Browse files
committed
Add more test
1 parent 911a818 commit 00ee7e2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/patmat/t11457b.scala

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
sealed trait Command {
2+
type Reply
3+
}
4+
5+
final case class Create() extends Command {
6+
type Reply = CreateReply
7+
val reply: Reply = CreateReply()
8+
}
9+
10+
final case class Set() extends Command {
11+
type Reply = SetReply
12+
val reply: Reply = SetReply()
13+
}
14+
15+
case class CreateReply()
16+
case class SetReply()
17+
18+
def process[R](command: Command { type Reply = R }): R =
19+
command match {
20+
case create: Create => create.reply
21+
case set: Set => set.reply
22+
// ^
23+
// Warning: unreachable code
24+
}

0 commit comments

Comments
 (0)