Skip to content

Conversation

@nathannewyen
Copy link

Improves the error message when a non-type is used where a type is expected.

Before: 'A' isn't a type.
After: 'A' is a setter, but a type was expected.

The element kind is now included (setter, getter, function, method, variable, etc.) to help users understand what the identifier refers to.

Fixes #48603

Changes the error message from:
  "'A' isn't a type."
To:
  "'A' is a setter, but a type was expected."

This provides more context about what the identifier actually refers to,
making it easier to understand and fix the issue.

Fixes dart-lang#48603
@copybara-service
Copy link

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/469420

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message for typo in setter name

1 participant