Skip to content

Commit 0adc3bc

Browse files
committed
Untagged variants error messages
Add tests. See #6272
1 parent 53e24ed commit 0adc3bc

File tree

6 files changed

+34
-0
lines changed

6 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedNonUnary1.res:2:1-27
4+
5+
1 │ @unboxed
6+
2 │ type t = Tuple(int, string)
7+
3 │
8+
9+
This type cannot be unboxed because
10+
its constructor has more than one argument.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedNonUnary2.res:2:1-42
4+
5+
1 │ @unboxed
6+
2 │ type t = Tuple(int, string) | Float(float)
7+
3 │
8+
9+
This type cannot be unboxed because it has more than one constructor.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedUnknown.res:2:10-31
4+
5+
1 │ @unboxed
6+
2 │ type t = Tuple((float, string)) | Float(float)
7+
3 │
8+
9+
This untagged variant definition is invalid: An unknown case must be the only case with payloads.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@unboxed
2+
type t = Tuple(int, string)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@unboxed
2+
type t = Tuple(int, string) | Float(float)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@unboxed
2+
type t = Tuple((float, string)) | Float(float)

0 commit comments

Comments
 (0)