Skip to content

Enforce strict-raw-types #2791

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

Merged
merged 4 commits into from
Sep 27, 2021
Merged

Enforce strict-raw-types #2791

merged 4 commits into from
Sep 27, 2021

Conversation

srawlins
Copy link
Member

Enabling strict-raw-types leads to changes in a few categories:

  • use var for inference
  • put a type on a raw Future
  • put a bound on a type parameter like Object
  • put types on a raw Map. Cringe. This one doesn't look pretty, but can be helped once we migrate to null safety with the use of non-function type aliases.

@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label Sep 16, 2021
Copy link
Contributor

@jcollins-g jcollins-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, yeah, I'm not a fan of the explicit Object everywhere but I like how strict-raw-types seems to eliminate the ambiguity about what is derived vs implicit dynamic.

@@ -7,6 +7,8 @@ analyzer:
todo: ignore
unused_import: warning
unused_shown_name: warning
language:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably should be added to analysis_options_presubmit.yaml?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@srawlins
Copy link
Member Author

Yeah T extends Object definitely makes my head scratch, for now. It looks like it is indicating some important grand distinction, when really it's just to avoid dynamic. I hope it just becomes more familiar.

@jcollins-g jcollins-g merged commit f146d9d into dart-lang:master Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants