-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweak unbound record field error message
- Loading branch information
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
jscomp/build_tests/super_errors/expected/unbound_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,16 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/unbound_record_field.res[0m:[2m3:6-21[0m | ||
|
||
1 [2m│[0m let foo = x => | ||
2 [2m│[0m switch x { | ||
[1;31m3[0m [2m│[0m | {[1;31msomeUnknownField[0m: 123} => () | ||
4 [2m│[0m } | ||
5 [2m│[0m | ||
|
||
[1;33msomeUnknownField[0m refers to a record field, but the record type it belongs to couldn't be found automatically. | ||
|
||
If it's defined in another module or file, bring it into scope by: | ||
- Prefixing it with said module name: [1;33mTheModule.someUnknownField[0m | ||
- Or specifying its type: | ||
[1;33mlet theValue: TheModule.theType = {someUnknownField: VALUE}[0m |
4 changes: 4 additions & 0 deletions
4
jscomp/build_tests/super_errors/fixtures/unbound_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,4 @@ | ||
let foo = x => | ||
switch x { | ||
| {someUnknownField: 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