Skip to content

Commit fec7103

Browse files
committed
super_errors_multi: cover includecore Privacy, Field_mutable, Field_optional, Unboxed_representation, Tag_name mismatches
1 parent 024707c commit fec7103

15 files changed

Lines changed: 117 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
===== Foo.res =====
2+
3+
We've found a bug for you!
4+
/.../fixtures/Iface_field_mutable_mismatch/Foo.res:1:1-21
5+
6+
1 │ type t = {count: int}
7+
2 │
8+
9+
The implementation /.../fixtures/Iface_field_mutable_mismatch/Foo.res
10+
does not match the interface /.../fixtures/Iface_field_mutable_mismatch/foo.cmi:
11+
Type declarations do not match:
12+
type t = {count: int}
13+
is not included in
14+
type t = {mutable count: int}
15+
/.../fixtures/Iface_field_mutable_mismatch/Foo.resi:1:1-29:
16+
Expected declaration
17+
/.../fixtures/Iface_field_mutable_mismatch/Foo.res:1:1-21:
18+
Actual declaration
19+
The mutability of field count is different.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
===== Foo.res =====
2+
3+
We've found a bug for you!
4+
/.../fixtures/Iface_field_optional_mismatch/Foo.res:1:1-28
5+
6+
1 │ type t = {a: int, b: string}
7+
2 │
8+
9+
The implementation /.../fixtures/Iface_field_optional_mismatch/Foo.res
10+
does not match the interface /.../fixtures/Iface_field_optional_mismatch/foo.cmi:
11+
Type declarations do not match:
12+
type t = {a: int, b: string}
13+
is not included in
14+
type t = {a: int, b?: string}
15+
/.../fixtures/Iface_field_optional_mismatch/Foo.resi:1:1-29:
16+
Expected declaration
17+
/.../fixtures/Iface_field_optional_mismatch/Foo.res:1:1-28:
18+
Actual declaration
19+
The optional attribute of field b is different.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
===== Foo.res =====
2+
3+
We've found a bug for you!
4+
/.../fixtures/Iface_privacy_mismatch/Foo.res:1:1-20
5+
6+
1 │ type t = private int
7+
2 │
8+
9+
The implementation /.../fixtures/Iface_privacy_mismatch/Foo.res
10+
does not match the interface /.../fixtures/Iface_privacy_mismatch/foo.cmi:
11+
Type declarations do not match:
12+
type t = int
13+
is not included in
14+
type t = int
15+
/.../fixtures/Iface_privacy_mismatch/Foo.resi:1:1-12:
16+
Expected declaration
17+
/.../fixtures/Iface_privacy_mismatch/Foo.res:1:1-20:
18+
Actual declaration
19+
A private type would be revealed.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
===== Foo.res =====
2+
3+
We've found a bug for you!
4+
/.../fixtures/Iface_tag_name_mismatch/Foo.res:2:1-4:5
5+
6+
1 │ @tag("type")
7+
2 │ type t =
8+
3 │  | @as("a") A
9+
4 │  | B
10+
5 │
11+
12+
The implementation /.../fixtures/Iface_tag_name_mismatch/Foo.res
13+
does not match the interface /.../fixtures/Iface_tag_name_mismatch/foo.cmi:
14+
Type declarations do not match:
15+
type t = @as("a") A | B
16+
is not included in
17+
type t = @as("a") A | B
18+
/.../fixtures/Iface_tag_name_mismatch/Foo.resi:2:1-4:5:
19+
Expected declaration
20+
/.../fixtures/Iface_tag_name_mismatch/Foo.res:2:1-4:5:
21+
Actual declaration
22+
Their @tag annotations differ.
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_unboxed_variant_mismatch/Foo.res:1:1-2:13
5+
6+
1 │ type t =
7+
2 │  | Wrap(int)
8+
3 │
9+
10+
The implementation /.../fixtures/Iface_unboxed_variant_mismatch/Foo.res
11+
does not match the interface /.../fixtures/Iface_unboxed_variant_mismatch/foo.cmi:
12+
Type declarations do not match:
13+
type t = Wrap(int)
14+
is not included in
15+
@unboxed type t = Wrap(int)
16+
/.../fixtures/Iface_unboxed_variant_mismatch/Foo.resi:2:1-3:13:
17+
Expected declaration
18+
/.../fixtures/Iface_unboxed_variant_mismatch/Foo.res:1:1-2:13:
19+
Actual declaration
20+
Their internal representations differ:
21+
the second declaration uses unboxed representation.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type t = {count: int}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type t = {mutable count: int}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type t = {a: int, b: string}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type t = {a: int, b?: string}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
type t = private int

0 commit comments

Comments
 (0)