-
Notifications
You must be signed in to change notification settings - Fork 469
convert more warnings in OCaml syntax to ReScript syntax #5468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
119d36c
convert more warnings in OCaml syntax to ReScript syntax
zth 9bbea5c
change non closed record pattern warning to res syntax
zth 82a2314
get rid of redundant parens, and add spacing between |
zth 85d5826
more formatting and cases for array pattern matching
zth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
100 changes: 100 additions & 0 deletions
100
jscomp/build_tests/super_errors/expected/warnings5.res.expected
This file contains hidden or 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,100 @@ | ||
|
||
[1;33mWarning number 9[0m | ||
[36m/.../fixtures/warnings5.res[0m:[2m12:3-21[0m | ||
|
||
10 [2m│[0m | ||
11 [2m│[0m switch y { | ||
[1;33m12[0m [2m│[0m | [1;33m{otherValue: false}[0m => Js.log("first") | ||
13 [2m│[0m } | ||
14 [2m│[0m | ||
|
||
the following labels are not bound in this record pattern: someValue, typ | ||
Either bind these labels explicitly or add ', _' to the pattern. | ||
|
||
|
||
[1;33mWarning number 8[0m | ||
[36m/.../fixtures/warnings5.res[0m:[2m11:1-13:1[0m | ||
|
||
9 [2m│[0m @val external y: someRecord = "otherVariable" | ||
10 [2m│[0m | ||
[1;33m11[0m [2m│[0m [1;33mswitch y {[0m | ||
[1;33m12[0m [2m│[0m [1;33m| {otherValue: false} => Js.log("first")[0m | ||
[1;33m13[0m [2m│[0m [1;33m}[0m | ||
14 [2m│[0m | ||
15 [2m│[0m switch y { | ||
|
||
You forgot to handle a possible case here, for example: | ||
{otherValue: true} | ||
|
||
|
||
[1;33mWarning number 9[0m | ||
[36m/.../fixtures/warnings5.res[0m:[2m16:3-26[0m | ||
|
||
14 [2m│[0m | ||
15 [2m│[0m switch y { | ||
[1;33m16[0m [2m│[0m | [1;33m{typ: WithPayload(true)}[0m => Js.log("first") | ||
17 [2m│[0m } | ||
18 [2m│[0m | ||
|
||
the following labels are not bound in this record pattern: someValue, otherValue | ||
Either bind these labels explicitly or add ', _' to the pattern. | ||
|
||
|
||
[1;33mWarning number 8[0m | ||
[36m/.../fixtures/warnings5.res[0m:[2m15:1-17:1[0m | ||
|
||
13 [2m│[0m } | ||
14 [2m│[0m | ||
[1;33m15[0m [2m│[0m [1;33mswitch y {[0m | ||
[1;33m16[0m [2m│[0m [1;33m| {typ: WithPayload(true)} => Js.log("first")[0m | ||
[1;33m17[0m [2m│[0m [1;33m}[0m | ||
18 [2m│[0m | ||
19 [2m│[0m let arr = [1] | ||
|
||
You forgot to handle a possible case here, for example: | ||
{typ: WithPayload(false)} | | ||
{typ: Variant | One | Two | Three | Four | Five | Six | Seven(_)} | ||
|
||
|
||
[1;33mWarning number 8[0m | ||
[36m/.../fixtures/warnings5.res[0m:[2m21:1-23:1[0m | ||
|
||
19 [2m│[0m let arr = [1] | ||
20 [2m│[0m | ||
[1;33m21[0m [2m│[0m [1;33mswitch arr {[0m | ||
[1;33m22[0m [2m│[0m [1;33m| [] => Js.log("")[0m | ||
[1;33m23[0m [2m│[0m [1;33m}[0m | ||
24 [2m│[0m | ||
25 [2m│[0m switch arr { | ||
|
||
You forgot to handle a possible case here, for example: | ||
[_] | ||
|
||
|
||
[1;33mWarning number 8[0m | ||
[36m/.../fixtures/warnings5.res[0m:[2m25:1-27:1[0m | ||
|
||
23 [2m│[0m } | ||
24 [2m│[0m | ||
[1;33m25[0m [2m│[0m [1;33mswitch arr {[0m | ||
[1;33m26[0m [2m│[0m [1;33m| [one] => Js.log(one)[0m | ||
[1;33m27[0m [2m│[0m [1;33m}[0m | ||
28 [2m│[0m | ||
29 [2m│[0m switch arr { | ||
|
||
You forgot to handle a possible case here, for example: | ||
[] | ||
|
||
|
||
[1;33mWarning number 8[0m | ||
[36m/.../fixtures/warnings5.res[0m:[2m29:1-31:1[0m | ||
|
||
27 [2m│[0m } | ||
28 [2m│[0m | ||
[1;33m29[0m [2m│[0m [1;33mswitch arr {[0m | ||
[1;33m30[0m [2m│[0m [1;33m| [1, 2] => ()[0m | ||
[1;33m31[0m [2m│[0m [1;33m}[0m | ||
32 [2m│[0m | ||
|
||
You forgot to handle a possible case here, for example: | ||
[1, 0] | [0, _] | [] |
This file contains hidden or 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,31 @@ | ||
type someTyp = Variant | WithPayload(bool) | One | Two | Three | Four | Five | Six | Seven(int) | ||
|
||
type someRecord = { | ||
someValue: string, | ||
otherValue: bool, | ||
typ: someTyp, | ||
} | ||
|
||
@val external y: someRecord = "otherVariable" | ||
|
||
switch y { | ||
| {otherValue: false} => Js.log("first") | ||
} | ||
|
||
switch y { | ||
| {typ: WithPayload(true)} => Js.log("first") | ||
} | ||
|
||
let arr = [1] | ||
|
||
switch arr { | ||
| [] => Js.log("") | ||
} | ||
|
||
switch arr { | ||
| [one] => Js.log(one) | ||
} | ||
|
||
switch arr { | ||
| [1, 2] => () | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.