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

Wrong Null warning on const building from function parameters #47351

Closed
ChaserVasya opened this issue Oct 1, 2021 · 1 comment
Closed

Wrong Null warning on const building from function parameters #47351

ChaserVasya opened this issue Oct 1, 2021 · 1 comment
Labels
analyzer-constants analyzer-ux area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@ChaserVasya
Copy link

Snipped and problem:

image

bar is definitly nonNull. But the third warning states the opposite. Other warnings are true.

dart --version :
Dart SDK version: 2.14.2 (stable) (Wed Sep 15 12:32:06 2021 +0200) on "windows_x64"

@eernstg eernstg added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Oct 1, 2021
@srawlins srawlins added analyzer-ux P3 A lower priority bug or feature request labels Oct 1, 2021
@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Nov 29, 2021
copybara-service bot pushed a commit that referenced this issue Jul 25, 2023
…onstant value.

evaluateConstructorCall now returns a Constant, which means evaluation may be cut early in some places if there's an error. However, some code generators rely on _InstanceCreationEvaluator to complete, and so there's no _major_ changes to the design right now (and some small additions to avoid breaking many tests).

This CL is just the framework for the "return Constant" design and will be the base for reporting better errors in constructor invocations.

These changes already show that we cut some amount of over-reporting in our existing language and unit tests, which is a step in the right direction.

Bug: #47603, #47351, #49389

Change-Id: I5ba7f1282658884c18a32d5e98c7804bbfeac0f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312347
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
@kallentu
Copy link
Member

Fixed after ba00516.

copybara-service bot pushed a commit that referenced this issue Jul 26, 2023
… be assigned to a parameter' overreporting in the const evaluator.

The constant evaluator now handles invalid types better and won't overreport this nonsensical error.

Bug: #47603, #47351, #49389
Change-Id: I63c253d2177c2b8c259c364e83753653eac1cae0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312707
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-constants analyzer-ux area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants