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

No null-promotion in list literal. #39667

Closed
lrhn opened this issue Dec 5, 2019 · 1 comment
Closed

No null-promotion in list literal. #39667

lrhn opened this issue Dec 5, 2019 · 1 comment
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. NNBD Issues related to NNBD Release type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lrhn
Copy link
Member

lrhn commented Dec 5, 2019

Example code:

main(List<String>? args) {
  var list = [ if (args != null) ... args ];
}

Here I get a warning that args is nullable, which the test should have ensured that it isn't.

The actual code which that hit this was more like:

String? reason = ...;
var list = [ something, something, if (reason != null) ...utf8.encode(reason) ];

so I can't just use ...?.

@lrhn lrhn added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) NNBD Issues related to NNBD Release labels Dec 5, 2019
@scheglov scheglov self-assigned this Dec 6, 2019
@scheglov
Copy link
Contributor

scheglov commented Dec 6, 2019

dart-bot pushed a commit that referenced this issue Dec 7, 2019
Bug: #39667
Change-Id: I4528869a8d39d1b27c0cdf21ab20173bdb0efbc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127482
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
@scheglov scheglov closed this as completed Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. NNBD Issues related to NNBD Release type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants