-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flip order of error message for wrong name (#6336)
* flip order of error message for wrong name * cleanup * changelog
- Loading branch information
Showing
8 changed files
with
100 additions
and
3 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
13 changes: 13 additions & 0 deletions
13
jscomp/build_tests/super_errors/expected/component_missing_prop_test.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/component_missing_prop_test.res[0m:[2m5:35-39[0m | ||
|
||
3 [2m│[0m type props<'name> = {name: 'name} | ||
4 [2m│[0m | ||
[1;31m5[0m [2m│[0m let make = (): props<'name> => {[1;31mnname[0m: "hello"} | ||
6 [2m│[0m } | ||
7 [2m│[0m | ||
|
||
This record expression is expected to have type [1;33m'test[0m | ||
The field [1;31mnname[0m does not belong to type [1;33mprops[0m | ||
Hint: Did you mean name? |
23 changes: 23 additions & 0 deletions
23
jscomp/build_tests/super_errors/expected/wrong_name_component_prop.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/wrong_name_component_prop.res[0m:[2m32:28-38[0m | ||
|
||
30 [2m│[0m } | ||
31 [2m│[0m | ||
[1;31m32[0m [2m│[0m let dddd = Component.make({[1;31mnonExistant[0m: "hello"}) | ||
33 [2m│[0m | ||
|
||
The field [1;31mnonExistant[0m does not belong to type [1;33mComponent.props[0m | ||
|
||
This record expression is expected to have type | ||
[1;33mComponent.props< | ||
string, | ||
string, | ||
string, | ||
string, | ||
string, | ||
string, | ||
string, | ||
string, | ||
string, | ||
>[0m |
13 changes: 13 additions & 0 deletions
13
jscomp/build_tests/super_errors/expected/wrong_name_record_field.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/wrong_name_record_field.res[0m:[2m4:3-4[0m | ||
|
||
2 [2m│[0m | ||
3 [2m│[0m let ff: d = { | ||
[1;31m4[0m [2m│[0m [1;31mzz[0m: 123, | ||
5 [2m│[0m } | ||
6 [2m│[0m | ||
|
||
The field [1;31mzz[0m does not belong to type [1;33md[0m | ||
|
||
This record expression is expected to have type [1;33md[0m |
6 changes: 6 additions & 0 deletions
6
jscomp/build_tests/super_errors/fixtures/component_missing_prop_test.res
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Since the React transform isn't active in the tests, mimic what the transform outputs. | ||
module Component = { | ||
type props<'name> = {name: 'name} | ||
|
||
let make = (): props<'name> => {nname: "hello"} | ||
} |
32 changes: 32 additions & 0 deletions
32
jscomp/build_tests/super_errors/fixtures/wrong_name_component_prop.res
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module SomeComplicatedModuleStructure = { | ||
module NestedModuleHere = { | ||
type t = string | ||
} | ||
} | ||
|
||
module Component = { | ||
type props<'name, 'second, 'third, 'fourth, 'fifth, 'sixth, 'seventh, 'eight, 'ninth> = { | ||
name: 'name, | ||
second: 'second, | ||
third: 'third, | ||
fourth: 'fourth, | ||
fifth: 'fifth, | ||
sixth: 'sixth, | ||
seventh: 'seventh, | ||
eight: 'eight, | ||
ninth: 'ninth, | ||
} | ||
let make = props => { | ||
props.name ++ | ||
props.second ++ | ||
props.third ++ | ||
props.fourth ++ | ||
props.fifth ++ | ||
props.sixth ++ | ||
props.seventh ++ | ||
props.eight ++ | ||
props.ninth | ||
} | ||
} | ||
|
||
let dddd = Component.make({nonExistant: "hello"}) |
5 changes: 5 additions & 0 deletions
5
jscomp/build_tests/super_errors/fixtures/wrong_name_record_field.res
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type d = {z: int} | ||
|
||
let ff: d = { | ||
zz: 123, | ||
} |
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