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

enable strict-raw-types #151

Open
goderbauer opened this issue Sep 19, 2023 · 2 comments
Open

enable strict-raw-types #151

goderbauer opened this issue Sep 19, 2023 · 2 comments

Comments

@goderbauer
Copy link
Contributor

goderbauer commented Sep 19, 2023

Similar to #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 #149.

@goderbauer goderbauer changed the title enable strict-raw-types enable strict-raw-types Sep 19, 2023
@lrhn
Copy link
Member

lrhn commented Sep 20, 2023

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.

@devoncarew
Copy link
Member

From a discussion with @leafpetersen, he saw challenges with this analysis mode (as it's implemented today?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: More investigation needed
Development

No branches or pull requests

3 participants