Skip to content

Commit 24cef59

Browse files
committed
super_errors_multi: cover includecore Variant_representation via different @as tag types
1 parent fec7103 commit 24cef59

4 files changed

Lines changed: 32 additions & 6 deletions

File tree

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
===== Foo.res =====
22

33
We've found a bug for you!
4-
/.../fixtures/Iface_unboxed_variant_mismatch/Foo.res:1:1-2:13
4+
/.../fixtures/Iface_unboxed_variant_mismatch/Foo.res:1:1-18
55

6-
1 │ type t =
7-
2 │  | Wrap(int)
8-
3 │
6+
1 │ type t = Wrap(int)
7+
2 │
98

109
The implementation /.../fixtures/Iface_unboxed_variant_mismatch/Foo.res
1110
does not match the interface /.../fixtures/Iface_unboxed_variant_mismatch/foo.cmi:
1211
Type declarations do not match:
1312
type t = Wrap(int)
1413
is not included in
1514
@unboxed type t = Wrap(int)
16-
/.../fixtures/Iface_unboxed_variant_mismatch/Foo.resi:2:1-3:13:
15+
/.../fixtures/Iface_unboxed_variant_mismatch/Foo.resi:2:1-18:
1716
Expected declaration
18-
/.../fixtures/Iface_unboxed_variant_mismatch/Foo.res:1:1-2:13:
17+
/.../fixtures/Iface_unboxed_variant_mismatch/Foo.res:1:1-18:
1918
Actual declaration
2019
Their internal representations differ:
2120
the second declaration uses unboxed representation.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
===== Foo.res =====
2+
3+
We've found a bug for you!
4+
/.../fixtures/Iface_variant_representation_mismatch/Foo.res:1:1-3:5
5+
6+
1 │ type t =
7+
2 │  | @as(0) A
8+
3 │  | B
9+
4 │
10+
11+
The implementation /.../fixtures/Iface_variant_representation_mismatch/Foo.res
12+
does not match the interface /.../fixtures/Iface_variant_representation_mismatch/foo.cmi:
13+
Type declarations do not match:
14+
type t = @as(0) A | B
15+
is not included in
16+
type t = @as("zero") A | B
17+
/.../fixtures/Iface_variant_representation_mismatch/Foo.resi:1:1-3:5:
18+
Expected declaration
19+
/.../fixtures/Iface_variant_representation_mismatch/Foo.res:1:1-3:5:
20+
Actual declaration
21+
The internal representations for case A are not equal.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
type t =
2+
| @as(0) A
3+
| B
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
type t =
2+
| @as("zero") A
3+
| B

0 commit comments

Comments
 (0)