-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
164 changed files
with
1,225 additions
and
34,470 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
jscomp/build_tests/super_errors/expected/modules2.res.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/modules2.res[0m:[2m1:9-14[0m | ||
[36m/.../fixtures/modules2.res[0m:[2m1:9-19[0m | ||
|
||
[1;31m1[0m [2m│[0m let b = [1;31mList.b[0m | ||
[1;31m1[0m [2m│[0m let b = [1;31mBelt.List.b[0m | ||
2 [2m│[0m | ||
|
||
The value b can't be found in List | ||
The value b can't be found in Belt.List |
17 changes: 10 additions & 7 deletions
17
jscomp/build_tests/super_errors/expected/primitives7.res.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/primitives7.res[0m:[2m3:24[0m | ||
[36m/.../fixtures/primitives7.res[0m:[2m3:23[0m | ||
|
||
1 [2m│[0m /* Wanted list(float), found list(int) */ | ||
2 [2m│[0m let a = list{1, 2, 3} | ||
[1;31m3[0m [2m│[0m List.map(n => n +. 2., [1;31ma[0m) | ||
[1;31m3[0m [2m│[0m a->Belt.List.map(n => [1;31mn[0m +. 2.) | ||
4 [2m│[0m | ||
|
||
This has type: [1;31mlist<int>[0m | ||
But this function argument is expecting: [1;33mlist<float>[0m | ||
|
||
The incompatible parts: | ||
[1;31mint[0m vs [1;33mfloat[0m | ||
This has type: [1;31mint[0m | ||
But it's being used with the [1;33m+.[0m operator, which works on: [1;33mfloat[0m | ||
|
||
Floats and ints have their own mathematical operators. This means you cannot add a float and an int without converting between the two. | ||
|
||
Possible solutions: | ||
- Ensure all values in this calculation has the type [1;33mfloat[0m. You can convert between floats and ints via [1;33mBelt.Float.toInt[0m and [1;33mBelt.Int.fromFloat[0m. | ||
- Change the operator to [1;33m+[0m, which works on [1;33mint[0m | ||
|
||
You can convert [1;33mint[0m to [1;33mfloat[0m with [1;33mBelt.Int.toFloat[0m. | ||
If this is a literal, try a number with a trailing dot (e.g. [1;33m20.[0m). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
let b = List.b | ||
let b = Belt.List.b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/* Wanted list(float), found list(int) */ | ||
let a = list{1, 2, 3} | ||
List.map(n => n +. 2., a) | ||
a->Belt.List.map(n => n +. 2.) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.