Skip to content
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

Errors reported by ConstantEvaluationValidator should be made more specific #47061

Open
srawlins opened this issue Aug 31, 2021 · 2 comments
Open
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@srawlins
Copy link
Member

Right now most errors use the default error, "Const variables must be initialized with a constant value." (const_initialized_with_non_constant_value). Each case can be given more information though, .e.g "constructor reference used in constant expression must be a const constructor."

@srawlins srawlins added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Aug 31, 2021
@bwilkerson
Copy link
Member

Yes, and many of them should have context messages associated with them. I took a look at this a couple of years ago but didn't have time for the amount of work that I thought would be necessary. Happy to discuss if you're interested.

@jcollins-g jcollins-g added type-enhancement A request for a change that isn't a bug P2 A bug or feature request we're likely to work on labels Aug 31, 2021
@asashour
Copy link
Contributor

asashour commented Sep 2, 2021

The only usage I see is

_reportErrors(result.errors,
CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE);

This is a new area for me, but am interested to help, hope further requirements are specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants