This repository was archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Don't parse Int token with suffices as hash ident for poly variants #408
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8e86046
Don't parse Int token with suffices as hash ident for poly variants
0bc0fd0
Tweak `variantIdent` error message based on feedback from bloodyowl
IwanKaramazow 5b61d76
Update hashIdent error tests
c3ea4bb
Add printer test to verify that int tokens with suffix aren't printed…
51ba479
Refine error message for numeric polyvars followed by a letter.
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
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,37 @@ | ||
|
||
Syntax error! | ||
tests/parsing/errors/other/hashIdent.res:1:10-12 | ||
|
||
1 │ let x = #10s | ||
2 │ | ||
3 │ type t = [ #red | #10s ] | ||
|
||
A numeric polymorphic variant cannot be followed by a letter. Did you mean `#10`? | ||
|
||
|
||
Syntax error! | ||
tests/parsing/errors/other/hashIdent.res:3:20-22 | ||
|
||
1 │ let x = #10s | ||
2 │ | ||
3 │ type t = [ #red | #10s ] | ||
4 │ | ||
5 │ switch x { | ||
|
||
A numeric polymorphic variant cannot be followed by a letter. Did you mean `#10`? | ||
|
||
|
||
Syntax error! | ||
tests/parsing/errors/other/hashIdent.res:6:4-6 | ||
|
||
4 │ | ||
5 │ switch x { | ||
6 │ | #10s => () | ||
7 │ } | ||
8 │ | ||
|
||
A numeric polymorphic variant cannot be followed by a letter. Did you mean `#10`? | ||
|
||
let x = `10 | ||
type nonrec t = [ `red | `10 ] | ||
;;match x with | `10 -> () |
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,7 @@ | ||
let x = #10s | ||
|
||
type t = [ #red | #10s ] | ||
|
||
switch x { | ||
| #10s => () | ||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bloodyowl what do you think of this new message? Specialized it to give a clear suggestion on what the user could do in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that looks better 👍