Open goderbauer opened 1 year ago
I'd suggest enabling both or neither.
Giving users protection against Foo()
inferring Foo<dynamic>
, but not against List<Foo> l;
inferring List<Foo<dynamic>>
, or vice versa, can give a false sense of security.
And I'd suggest "both".
It's a long-standing wish of mine to change the language to not infer or insert dynamic
as a default, so you, or someone else, have to explicitly write at least one dynamic
in order to get it. (And at the same time, using hacky "library versioning", I'd make the platform libraries use Object?
everywhere they expose dynamic
today.)
These "lints" being enabled will make such a change more viable, since code satisfying them will not need migrating for the inference/insertion change.
From a discussion with @leafpetersen, he saw challenges with this analysis mode (as it's implemented today?).
Similar to https://github.com/dart-lang/lints/issues/125, this is a proposal to enable
strict-raw-types
in the recommended lint set. We'd have to believe this is the way we want to recommend that people write Dart code.See also https://github.com/dart-lang/lints/issues/149.