Skip to content

Commit 5e2fc8a

Browse files
committed
[Super errors] Update tests
1 parent d59b264 commit 5e2fc8a

16 files changed

+64
-71
lines changed

jscomp/build_tests/super_errors/expected/collections.re.expected

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
1 │ /* wrong type in a list */
66
2 │ [1, 2, "Hello"];
77

8-
This has type:
9-
string
10-
But somewhere wanted:
11-
int
12-
8+
This has type: string
9+
Somewhere wanted: int
10+
1311
You can convert string to int with Belt.Int.fromString.

jscomp/build_tests/super_errors/expected/highlighting1.re.expected

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
2 │
77
3 │ lo";
88

9-
This has type:
10-
string
11-
But somewhere wanted:
12-
int
13-
9+
This has type: string
10+
Somewhere wanted: int
11+
1412
You can convert string to int with Belt.Int.fromString.

jscomp/build_tests/super_errors/expected/highlighting2.re.expected

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
3 ┆
88
4 ┆ lo";
99

10-
This has type:
11-
string
12-
But somewhere wanted:
13-
int
14-
10+
This has type: string
11+
Somewhere wanted: int
12+
1513
You can convert string to int with Belt.Int.fromString.

jscomp/build_tests/super_errors/expected/highlighting3.re.expected

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
3 │
88
4 │ loooooooooooooo";
99

10-
This has type:
11-
string
12-
But somewhere wanted:
13-
int
14-
10+
This has type: string
11+
Somewhere wanted: int
12+
1513
You can convert string to int with Belt.Int.fromString.

jscomp/build_tests/super_errors/expected/highlighting5.re.expected

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
2 │ let a: int = "helllllllllllllllllllllllllllllllllllllllllllllllllllllll
77
llllllllllllllllllllllllllll";
88

9-
This has type:
10-
string
11-
But somewhere wanted:
12-
int
13-
9+
This has type: string
10+
Somewhere wanted: int
11+
1412
You can convert string to int with Belt.Int.fromString.

jscomp/build_tests/super_errors/expected/primitives1.re.expected

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
1 │ /* got float, wanted int */
66
2 │ 2. + 2;
77

8-
This has type:
9-
float
10-
But somewhere wanted:
11-
int
12-
8+
This has type: float
9+
Somewhere wanted: int
10+
1311
You can convert float to int with Belt.Float.toInt.If this is a literal, you want a number without a trailing dot (e.g. 20).
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/primitives11.re:5:11-27
4+
5+
3 │ type a = option(aa)
6+
4 │ type b = option(bb)
7+
5 │ let a:a = (Some(Some(5)):b)
8+
9+
This has type: b (defined as option(bb))
10+
Somewhere wanted: a (defined as option(aa))
11+
12+
The incompatible parts:
13+
bb (defined as option(int)) vs aa (defined as option(string))
14+
15+
Further expanded:
16+
int vs string
17+
18+
You can convert int to string with Belt.Int.toString.

jscomp/build_tests/super_errors/expected/primitives2.re.expected

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
1 │ /* got int, wanted string */
66
2 │ 2 ++ " things";
77

8-
This has type:
9-
int
10-
But somewhere wanted:
11-
string
12-
8+
This has type: int
9+
Somewhere wanted: string
10+
1311
You can convert int to string with Belt.Int.toString.

jscomp/build_tests/super_errors/expected/primitives6.re.expected

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
2 │ type x = X(int, float);
77
3 │ X(10, 10);
88

9-
This has type:
10-
int
11-
But somewhere wanted:
12-
float
13-
9+
This has type: int
10+
Somewhere wanted: float
11+
1412
You can convert int to float with Belt.Int.toFloat.If this is a literal, you want a number with a trailing dot (e.g. 20.).

jscomp/build_tests/super_errors/expected/primitives7.re.expected

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66
2 │ let a = [1,2,3];
77
3 │ List.map(((n) => n +. 2.), a);
88

9-
This has type:
10-
list(int)
11-
But somewhere wanted:
12-
list(float)
9+
This has type: list(int)
10+
Somewhere wanted: list(float)
1311

1412
The incompatible parts:
15-
int
16-
vs
17-
float
18-
13+
int vs float
14+
1915
You can convert int to float with Belt.Int.toFloat.If this is a literal, you want a number with a trailing dot (e.g. 20.).

0 commit comments

Comments
 (0)