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

Update old examples involving implicit downcasts #3304

Closed
parlough opened this issue Jun 6, 2021 · 5 comments · Fixed by #3337
Closed

Update old examples involving implicit downcasts #3304

parlough opened this issue Jun 6, 2021 · 5 comments · Fixed by #3337
Labels
dev.null-safety Relates to transforming or migrating Dart code to sound null safety e1-hours Can complete in < 8 hours of normal, not dedicated, work p2-medium Necessary but not urgent concern. Resolve when possible.

Comments

@parlough
Copy link
Member

parlough commented Jun 6, 2021

Update examples in analyzer documentation and type system documentation around implicit downcasts since they were removed with null safety. There may be other cases as well.

The example in Enabling stricter type checks is no longer relevant as it won't work without the option anyway.

As we migrate The Dart type system article we'll need to keep this in mind as well.

@parlough parlough added p2-medium Necessary but not urgent concern. Resolve when possible. e1-hours Can complete in < 8 hours of normal, not dedicated, work act.question Relates to issues that writers need SME help labels Jun 6, 2021
@parlough parlough closed this as completed Jun 6, 2021
@parlough parlough changed the title Investigate why example of setting implicit-casts: false doesn't work with or without it and update accordingly Update old examples involving implicit downcasts Jun 6, 2021
@parlough parlough reopened this Jun 6, 2021
@parlough parlough added dev.null-safety Relates to transforming or migrating Dart code to sound null safety and removed act.question Relates to issues that writers need SME help labels Jun 6, 2021
@parlough
Copy link
Member Author

parlough commented Jun 7, 2021

@bwilkerson Does implicit-casts: false have any remaining functionality in >= 2.12 that should be documented or should I just add a note explaining it is as no longer functional?

analyzer:
  strong-mode:
    implicit-casts: false

Sidenote: If it doesn't have any functionality anymore, perhaps there could be a hint/lint with an explanation why it's not useful anymore.

@bwilkerson
Copy link
Member

I think that's been replaced by other flags, but @srawlins would know more definitively. But yes, I agree that if it's deprecated / dead then we should remove it from the external docs and have a warning for it.

@srawlins
Copy link
Member

srawlins commented Jun 9, 2021

implicit-casts still reports when a cast is made from dynamic to another type (if I'm not mistaken), but Dart 2.12 with null safety allows this, so it still has functionality.

parlough added a commit to parlough/site-www that referenced this issue Jun 15, 2021
@kwalrath
Copy link
Contributor

kwalrath commented Jun 15, 2021

If you're using 2.12/2.13 but your lower SDK bound is before that (i.e. you haven't opted into null safety), does implicit-casts still catch non-dynamic casts?

(I'm wondering whether we need to have wording that reflects language version rather than SDK version.)

@srawlins
Copy link
Member

That's correct, it would.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev.null-safety Relates to transforming or migrating Dart code to sound null safety e1-hours Can complete in < 8 hours of normal, not dedicated, work p2-medium Necessary but not urgent concern. Resolve when possible.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants