-
Notifications
You must be signed in to change notification settings - Fork 404
[ fix ] Backticked names cannot be used as prefix operators #3740
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| CharacterExcept : Type | ||
| CharacterExcept = `Elem` _ . fst | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| foo : Nat -> Nat | ||
| foo = `minus` 5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| 1/1: Building Issue3550 (Issue3550.idr) | ||
| Error: Cannot use backticked name as a prefix operator | ||
|
|
||
| Issue3550:2:19--2:25 | ||
| 1 | CharacterExcept : Type | ||
| 2 | CharacterExcept = `Elem` _ . fst | ||
| ^^^^^^ | ||
|
|
||
| Possible solutions: | ||
| - Use section: (`Elem` _ . fst) | ||
| - Use application: Elem _ . fst | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This application has a different meaning as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don’t know what the user intended. In the first case, I'm suggesting the most likely option — a section. But it’s also possible that the backticks were just a typo.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah we can't run the typechecker at this stage to know which one is the one that the user meant. I think this is fine as the user will probably try both and pick the one that works |
||
| 1/1: Building Issue3739 (Issue3739.idr) | ||
| Error: Cannot use backticked name as a prefix operator | ||
|
|
||
| Issue3739:2:7--2:14 | ||
| 1 | foo : Nat -> Nat | ||
| 2 | foo = `minus` 5 | ||
| ^^^^^^^ | ||
|
|
||
| Possible solutions: | ||
| - Use section: (`minus` 5) | ||
| - Use application: minus 5 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| . ../../../testutils.sh | ||
|
|
||
| check Issue3550.idr | ||
| check Issue3739.idr |
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.
Should the section not be
?
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.
Should we be guessing the parenthesis placement here? Both cases could potentially be correct
Uh oh!
There was an error while loading. Please reload this page.
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.
The internal error occurred in the shunting algorithm, which reorders operators according to their precedence. That’s why I added this check before it. We could potentially run it, but I’m not sure it would be helpful