Skip to content

[Null-aware elements] Implement AST enhancements #56267

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
Tracked by #56266
chloestefantsova opened this issue Jul 17, 2024 · 0 comments
Closed
Tracked by #56266

[Null-aware elements] Implement AST enhancements #56267

chloestefantsova opened this issue Jul 17, 2024 · 0 comments
Labels
legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@chloestefantsova
Copy link
Contributor

A new AST node should be added to represent the null-aware elements in list and set literals:

testList(int? x) => <int>[?x];
testSet(int? x) => <int>[?x];

The MapLiteralEntry node should be updated to contain the optional null-aware tokens for the key and the value:

testNullAwareKey(int? x, String y) => <int, String>{?x: y};
testNullAwareValue(int x, String? y) => <int, String>{x: ?y};
testBothNullAware(int? x, String? y) => <int, String>{?x: ?y};
testNoneNullAware(int x, String y) => <int, String>{x: y};
@chloestefantsova chloestefantsova added legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug labels Jul 17, 2024
@srawlins srawlins added the P2 A bug or feature request we're likely to work on label Jul 17, 2024
copybara-service bot pushed a commit that referenced this issue Jul 19, 2024
This reverts commit 2bc2f89.

Reason for revert: breaks Flutter HHH

Original change's description:
> [analyzer][null-aware-elements] Add NullAwareElement AST node
>
> Closes #56267
>
> Part of #56266
> Part of #55949
>
> Change-Id: I7c79d6be312f579e95291f2c2d21e3f996500b87
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376101
> Reviewed-by: Keerti Parthasarathy <[email protected]>
> Reviewed-by: Konstantin Shcheglov <[email protected]>
> Commit-Queue: Chloe Stefantsova <[email protected]>

Change-Id: I31e35eec14585818baccb1d34b823f7f2b6bc4f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376800
Auto-Submit: Konstantin Shcheglov <[email protected]>
Reviewed-by: Siva Annamalai <[email protected]>
Commit-Queue: Siva Annamalai <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jul 24, 2024
This CL relands https://dart-review.googlesource.com/c/sdk/+/376101

Closes #56267

Part of #56266
Part of #55949

Change-Id: Icf5f3d799cddcef65c16e1720895611ed59e6d88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376901
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Chloe Stefantsova <[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. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants