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

Analysis options page should document strict modes #2338

Closed
srawlins opened this issue Apr 8, 2020 · 13 comments · Fixed by #3823
Closed

Analysis options page should document strict modes #2338

srawlins opened this issue Apr 8, 2020 · 13 comments · Fixed by #3823
Assignees
Labels
e1-hours Can complete in < 8 hours of normal, not dedicated, work e2-days Can complete in < 5 days of normal, not dedicated, work p2-medium Necessary but not urgent concern. Resolve when possible. t.cli-tools Relates to the dart command line tools

Comments

@srawlins
Copy link
Member

srawlins commented Apr 8, 2020

There are three strict analysis modes, strict-raw-types, strict-inference, and strict-casts. These should be documented at https://dart.dev/guides/language/analysis-options.

Summary:

I'd love to collaborate with someone on how the page should be updated.

These three modes are probably recommended over implicit-dynamic: false, so we could deprecate that (or stop documenting it) at the same time. I'll confer with my team on this deprecation idea.

@kwalrath kwalrath added e1-hours Can complete in < 8 hours of normal, not dedicated, work e2-days Can complete in < 5 days of normal, not dedicated, work p1-high Major but not urgent concern: Resolve in months. Update each month. t.cli-tools Relates to the dart command line tools labels Apr 9, 2020
@kwalrath
Copy link
Contributor

kwalrath commented Apr 9, 2020

/cc @bwilkerson @pq

@bwilkerson
Copy link
Member

I agree. I believe that we're now at a point where we can remove the documentation of the strong-mode option / section and replace it with the language options Sam mentioned.

@srawlins Just to confirm, are those the only two language options we plan to add at this point?

When we do this, we should be sure to update the characterization of the language options, which currently reads

Another tag you might see is language:, which is used for experimental language features.

I don't think we want to characterize these two modes as experiments.

@srawlins
Copy link
Member Author

I agree. I believe that we're now at a point where we can remove the documentation of the strong-mode option / section and replace it with the language options Sam mentioned.

Unfortunately, I got strong pushback from prominent voices inside google that implicit-casts: false is still useful and should not be deprecated. We had a plan to replace this mode with strict-casts, which would be almost identical, except that casts from dynamic would be allowed, to match the Null Safety type system. Again, users were saying that implicit-casts: false is useful as is. Perhaps we could create strict-casts to replace it, and with the exact same functionality.

But this work has not been done yet (I'd be in favor of prioritizing it). Maybe leave strong-mode alone for now?

@srawlins Just to confirm, are those the only two language options we plan to add at this point?

Correct. We have plans for strict-casts but it has not been prioritized.

I don't think we want to characterize these two modes as experiments.

Agree. They've been vetted by internal google and by the sass packages.

@bwilkerson
Copy link
Member

We had a plan to replace this mode with strict-casts, which would be almost identical, except that casts from dynamic would be allowed, to match the Null Safety type system.

That would have been useful when it was proposed, but at this point, with Null Safety as close as I hope it is, I don't think doing this would add enough value.

Again, users were saying that implicit-casts: false is useful as is. Perhaps we could create strict-casts to replace it, and with the exact same functionality.

That sounds good to me. I think it's reasonable to allow users to opt out of allowing implicit casts from dynamic.

In the meantime we can at least stop documenting the "strong-mode" options that have been replaced.

@kwalrath kwalrath added p2-medium Necessary but not urgent concern. Resolve when possible. and removed p1-high Major but not urgent concern: Resolve in months. Update each month. labels Feb 23, 2021
@parlough parlough self-assigned this Jul 10, 2021
@srawlins
Copy link
Member Author

There is now a third: strict-casts: true. I've updated the top description.

@parlough
Copy link
Member

I’ll work on these soon. Thanks for the update.

@kevmoo
Copy link
Member

kevmoo commented Jan 26, 2022

We should be clear about which SDK versions these appear in!

@srawlins
Copy link
Member Author

Good point; I've updated the summary with "since" versions; strict-casts is not in until 2.17.0

@parlough
Copy link
Member

parlough commented Feb 1, 2022

@srawlins Just to confirm, strict-casts will only be available in 2.17? https://github.com/dart-lang/language/blob/master/resources/type-system/strict-casts.md lists 2.16 and it seems to work in the (2.16) beta as well. Is it incomplete before 2.17?

@kevmoo
Copy link
Member

kevmoo commented Feb 1, 2022

Seems like it's 2.16 – works fine here dart-archive/ffigen#264

@srawlins
Copy link
Member Author

srawlins commented Feb 1, 2022

Ah yeah, sorry. I had checked 2.16.0-dev.0, but that is not the right thing to check 🤣 . 2.16.0 should be good.

dcharkes pushed a commit to dart-archive/ffi that referenced this issue Feb 1, 2022
@mit-mit
Copy link
Member

mit-mit commented Feb 3, 2022

Unfortunately, I got strong pushback from prominent voices inside google that implicit-casts: false is still useful and should not be deprecated.

We can still remove it here from the public docs if we don't feel it's something new, external developers should consider using. These docs should essentially be our recommendation for what things to use.

@parlough
Copy link
Member

parlough commented Feb 3, 2022

With strict-casts coming out in 2.16 that's no longer much of a worry. I am working on this now and outside of a mention of when strict-casts was introduced I don't plan to document implicit-casts much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e1-hours Can complete in < 8 hours of normal, not dedicated, work e2-days Can complete in < 5 days of normal, not dedicated, work p2-medium Necessary but not urgent concern. Resolve when possible. t.cli-tools Relates to the dart command line tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants