-
-
Notifications
You must be signed in to change notification settings - Fork 701
Fix issue 21284: Report "no property" error at identifier location instead of dot #22740
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: master
Are you sure you want to change the base?
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -2794,6 +2794,7 @@ class DotIdExp final : public UnaExp | |
| bool noderef; | ||
| bool wantsym; | ||
| bool arrow; | ||
| Loc identLoc; // location of the identifier (for accurate error reporting) | ||
| static DotIdExp* create(Loc loc, Expression* e, Identifier* ident); | ||
|
||
| void accept(Visitor* v) override; | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* | ||
| * Fix for issue 21284: "no property" error should point at the identifier, not the dot. | ||
| * The error location should be on the line of the undefined identifier (`three`), not the dot. | ||
| TEST_OUTPUT: | ||
| --- | ||
| fail_compilation/diag21284.d(17): Error: no property `three` for type `E` | ||
| fail_compilation/diag21284.d(10): enum `E` defined here | ||
| --- | ||
| */ | ||
| enum E { one, two } | ||
|
|
||
| void main() | ||
| { | ||
| auto x = | ||
| E | ||
| . | ||
| three; | ||
| } |
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.
need update this in the header too