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

[NNBD] No error in CFE for left hand of ??= operator #43278

Closed
sgrekhov opened this issue Sep 1, 2020 · 1 comment
Closed

[NNBD] No error in CFE for left hand of ??= operator #43278

sgrekhov opened this issue Sep 1, 2020 · 1 comment
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-missing-error NNBD Issues related to NNBD Release type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Sep 1, 2020

The following code produces an error in analyzer and no issues in VM

class C {
  int? x;
}

main() {
  C? c = new C();
  c.x ??= 42;  // Analyzer error - An expression whose value can be 'null' must be null-checked before it can be dereferenced.
}

There must be an error in CFE as well

Dart SDK version: 2.10.0-59.0.dev (dev) (Tue Aug 25 18:05:44 2020 -0700) on "windows_x64"

@lrhn lrhn added area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-missing-error NNBD Issues related to NNBD Release type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Sep 1, 2020
@chloestefantsova
Copy link
Contributor

The CL is in progress: https://dart-review.googlesource.com/c/sdk/+/162160.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-missing-error 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

3 participants