-
Notifications
You must be signed in to change notification settings - Fork 448
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
15 changed files
with
250 additions
and
177 deletions.
There are no files selected for viewing
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
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,20 +0,0 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/math_operator_int.res[0m:[2m3:9-11[0m | ||
|
||
1 [2m│[0m let num = 0. | ||
2 [2m│[0m | ||
[1;31m3[0m [2m│[0m let x = [1;31mnum[0m + 12. | ||
4 [2m│[0m | ||
|
||
This has type: [1;31mfloat[0m | ||
But it's being used with the [1;33m+[0m operator, which works on: [1;33mint[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;33mint[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;33mfloat[0m | ||
|
||
You can convert [1;33mfloat[0m to [1;33mint[0m with [1;33mBelt.Float.toInt[0m. | ||
If this is a literal, try a number without 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,16 +0,0 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/math_operator_string.res[0m:[2m1:9-15[0m | ||
|
||
[1;31m1[0m [2m│[0m let x = [1;31m"hello"[0m + "what" | ||
2 [2m│[0m | ||
|
||
This has type: [1;31mstring[0m | ||
But it's being used with the [1;33m+[0m operator, which works on: [1;33mint[0m | ||
|
||
Are you looking to concatenate strings? Use the operator [1;33m++[0m, which concatenates strings. | ||
|
||
Possible solutions: | ||
- Change the [1;33m+[0m operator to [1;33m++[0m to concatenate strings instead. | ||
|
||
You can convert [1;33mstring[0m to [1;33mint[0m with [1;33mBelt.Int.fromString[0m. | ||
18 changes: 6 additions & 12 deletions
18
jscomp/build_tests/super_errors/expected/primitives1.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,19 +1,13 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/primitives1.res[0m:[2m2:1-2[0m | ||
[36m/.../fixtures/primitives1.res[0m:[2m2:6[0m | ||
|
||
1 [2m│[0m /* got float, wanted int */ | ||
[1;31m2[0m [2m│[0m [1;31m2.[0m + 2 | ||
[1;31m2[0m [2m│[0m 2. + [1;31m2[0m | ||
3 [2m│[0m | ||
|
||
This value has type: [1;31mfloat[0m | ||
But it's being used with the [1;33m+[0m operator, which works on: [1;33mint[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;33mint[0m. You can convert between floats and ints via [1;33mBelt.Float.toInt[0m and [1;33mBelt.Int.fromFloat[0m. | ||
- Make [1;33m2.[0m an [1;33mint[0m by removing the dot or explicitly converting to int | ||
This has type: [1;31mint[0m | ||
But it's expected to have type: [1;33mfloat[0m | ||
|
||
You can convert [1;33mfloat[0m to [1;33mint[0m with [1;33mBelt.Float.toInt[0m. | ||
If this is a literal, try a number without a trailing dot (e.g. [1;33m20[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). |
18 changes: 6 additions & 12 deletions
18
jscomp/build_tests/super_errors/expected/type1.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,18 +1,12 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/type1.res[0m:[2m1:9-10[0m | ||
[36m/.../fixtures/type1.res[0m:[2m1:14[0m | ||
|
||
[1;31m1[0m [2m│[0m let x = [1;31m2.[0m + 2 | ||
[1;31m1[0m [2m│[0m let x = 2. + [1;31m2[0m | ||
2 [2m│[0m | ||
|
||
This value has type: [1;31mfloat[0m | ||
But it's being used with the [1;33m+[0m operator, which works on: [1;33mint[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;33mint[0m. You can convert between floats and ints via [1;33mBelt.Float.toInt[0m and [1;33mBelt.Int.fromFloat[0m. | ||
- Make [1;33m2.[0m an [1;33mint[0m by removing the dot or explicitly converting to int | ||
This has type: [1;31mint[0m | ||
But it's expected to have type: [1;33mfloat[0m | ||
|
||
You can convert [1;33mfloat[0m to [1;33mint[0m with [1;33mBelt.Float.toInt[0m. | ||
If this is a literal, try a number without a trailing dot (e.g. [1;33m20[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
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
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
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
Oops, something went wrong.