Unhelpful error, and no quick fix, when annotation needs to be imported. #20039
Labels
analyzer-ux
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
With an input file like this:
main() {
var x = new DomName('foo');
}
Analyzer issues the warning "Undefined class 'DomName'", along with the quick fix suggestion "Import library 'dart:html_common'". Which is great.
However, with an input file like this:
@DomName('foo')
class Foo {
}
the error is "Annotation can be only constant variable or constant constructor invocation", which is much less helpful, and there is no quick fix available.
The text was updated successfully, but these errors were encountered: