We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25a3773 commit ebfb238Copy full SHA for ebfb238
tests/neg/i4863.scala
@@ -0,0 +1,13 @@
1
+sealed trait Nat
2
+case class S(n: Nat) extends Nat
3
+case object Z extends Nat
4
+
5
+inline def pred(n: Nat) = inline n match {
6
+ case S(m) => m
7
+ case Z =>
8
+ compiletime.error("n cannot be Z")
9
+}
10
11
+class Test {
12
+ pred(Z) // error
13
tests/pos/i4863.scala
+ pred(S(Z))
0 commit comments