Closed
Description
Consider the following class member declaration:
class Queue {
static const initialCapacity = 16;
}
The type_annotate_public_apis
lint causes this issue to be reported:
lint • Type annotate public APIs at lib/language_tour/classes/misc.dart:22:16 • type_annotate_public_apis
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.