-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Better error for definition followed by keyword #18752
Merged
Merged
Changes from all commits
Commits
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 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 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,104 @@ | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:3:4 --------------------------------------------------------------------- | ||
3 |val do = 23 // error | ||
| ^ | ||
| an identifier expected, but 'do' found | ||
|--------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'do' as identifier, you may put it in backticks: `do`. | ||
--------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:4:4 --------------------------------------------------------------------- | ||
4 |val if = 23 // error | ||
| ^ | ||
| an identifier expected, but 'if' found | ||
|--------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'if' as identifier, you may put it in backticks: `if`. | ||
--------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:5:4 --------------------------------------------------------------------- | ||
5 |val val = 23 // error | ||
| ^ | ||
| an identifier expected, but 'val' found | ||
|--------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'val' as identifier, you may put it in backticks: `val`. | ||
--------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:6:7 --------------------------------------------------------------------- | ||
6 |val a, if = 23 // error | ||
| ^^ | ||
| an identifier expected, but 'if' found | ||
|--------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'if' as identifier, you may put it in backticks: `if`. | ||
--------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:8:4 --------------------------------------------------------------------- | ||
8 |def do; // error | ||
| ^^ | ||
| an identifier expected, but 'do' found | ||
|--------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'do' as identifier, you may put it in backticks: `do`. | ||
--------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:9:4 --------------------------------------------------------------------- | ||
9 |var do; // error | ||
| ^ | ||
| an identifier expected, but 'do' found | ||
|--------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'do' as identifier, you may put it in backticks: `do`. | ||
--------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:10:6 -------------------------------------------------------------------- | ||
10 |class do; // error | ||
| ^^ | ||
| an identifier expected, but 'do' found | ||
|-------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'do' as identifier, you may put it in backticks: `do`. | ||
-------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:11:7 -------------------------------------------------------------------- | ||
11 |object if; // error // error | ||
| ^^ | ||
| an identifier expected, but 'if' found | ||
|-------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'if' as identifier, you may put it in backticks: `if`. | ||
-------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:12:6 -------------------------------------------------------------------- | ||
12 |trait else; // error | ||
| ^^^^ | ||
| an identifier expected, but 'else' found | ||
|-------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'else' as identifier, you may put it in backticks: `else`. | ||
-------------------------------------------------------------------------------------------------------------------- | ||
-- [E040] Syntax Error: tests/neg/i18750.scala:13:5 -------------------------------------------------------------------- | ||
13 |type for; // error | ||
| ^^^ | ||
| an identifier expected, but 'for' found | ||
|-------------------------------------------------------------------------------------------------------------------- | ||
| Explanation (enabled by `-explain`) | ||
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| | ||
| If you want to use 'for' as identifier, you may put it in backticks: `for`. | ||
-------------------------------------------------------------------------------------------------------------------- | ||
-- [E161] Naming Error: tests/neg/i18750.scala:11:0 -------------------------------------------------------------------- | ||
11 |object if; // error // error | ||
|^ | ||
|<error> clashes with class <error> in tests/neg/i18750.scala; the two must be defined together | ||
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 @@ | ||
//> using options -explain | ||
|
||
val do = 23 // error | ||
val if = 23 // error | ||
val val = 23 // error | ||
val a, if = 23 // error | ||
|
||
def do; // error | ||
var do; // error | ||
class do; // error | ||
object if; // error // error | ||
trait else; // error | ||
type for; // error |
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.
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.
Note: This secondary error only on the
object
happens in combination with some of these other failures. This will probably not happen often in practice.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.
are you working more on this? (you disabled auto-merge)