Skip to content

Backporting .fromEnvironment updates: Get default values from element model, support hasEnvironment #41050

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

Closed
eernstg opened this issue Mar 16, 2020 · 2 comments
Assignees
Labels
legacy-area-analyzer Use area-devexp instead. NNBD Issues related to NNBD Release P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@eernstg
Copy link
Member

eernstg commented Mar 16, 2020

Cf. breaking change #40678, https://dart-review.googlesource.com/c/sdk/+/139286 introduced bool.hasEnvironment into the sdk/sdk_nnbd.

The next step would be to make the analyzer obtain the default value for the named parameter defaultValue of the bool, int, String constructors named fromEnvironment from the element model, such that it would work with both the sdk and the sdk_nnbd defaults without special casing.

Next again, evaluation of constant expressions of the form const bool.hasEnvironment(...) should be implemented, and this would then make the tests language{,_2}/bool/has_environment_{,not_new_}test.dart succeed.

@stereotype441, can you help finding a way to fit this into the analyzer team work plan?

@eernstg eernstg added the legacy-area-analyzer Use area-devexp instead. label Mar 16, 2020
@eernstg eernstg changed the title Backporting .fromEnvironment updates: Get default values from element model Backporting .fromEnvironment updates: Get default values from element model, support hasEnvironment Mar 16, 2020
@stereotype441 stereotype441 added the NNBD Issues related to NNBD Release label Mar 16, 2020
@stereotype441
Copy link
Member

@scheglov can you give this a priority? Thanks!

@stereotype441 stereotype441 added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Mar 16, 2020
@scheglov
Copy link
Contributor

dart-bot pushed a commit that referenced this issue Mar 17, 2020
…del.

Bug: #41050
Change-Id: I8fee34a6b5816a725df4e4886fc85061ac4ec9b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139661
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
dart-bot pushed a commit that referenced this issue Mar 18, 2020
Bug: #41050
Change-Id: I806c201dde6e4692a3252fef5aec2fbcbd663147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139823
Commit-Queue: Konstantin Shcheglov <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. NNBD Issues related to NNBD Release P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

3 participants