type_annotate_public_apis reports missing type for static const #57767
Labels
devexp-linter
Issues with the analyzer's support for the linter package
legacy-area-analyzer
Use area-devexp instead.
linter-false-positive
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Consider the following class member declaration:
The
type_annotate_public_apis
lint causes this issue to be reported:Being a
static const
, its type is fully determined at compile time from the initializer, so a type annotation would be redundant, and certainly should not be required -- as the lint message seems to suggest.Of course, such a static const w/o an explicit type annotation can end up having type
dynamic
, which might not be desirable, but that is another issue addressed via the--no-implicit-dynamic
flag IMHO.cc @munificent @kwalrath @kevmoo
The text was updated successfully, but these errors were encountered: