Commit Graph

3 Commits

Author SHA1 Message Date
Johnni Winther 383b470d39 [test] Update never_runtime_check_nnbd to match new expectations
The test was written when a more disruptive solution for the unsoundness
fix was planned. A more lenient solution was found and the test is updated
accordingly.

Closes #43707

Change-Id: I31936fdc3aa0ae23fddd72c850eca5da50b22352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166620
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-08 15:08:05 +00:00
Paul Berry 343148f60a More test cases for never_runtime_check.
These test cases cover the following scenarios:

- `is` and `is!` tests that do not appear inside an "if" statement.

- `== null` and `!= null` tests that do not appear inside an "if"
  statement.

- `??=` assignment where the "write" type is nullable but the "read"
  type is non-nullable (to make sure the implementation is using the
  read type to decide whether to insert the null check).

- `??=` assignment where the LHS is a super call to the index operator.

- `??=` assignment where the LHS is accessed through an extension
  (either explicitly or implicitly).

- `??=` assignment where the LHS is a null-aware indexed operator.

- Null-aware access to a getter.

- Null-aware access via a cascade.

- Null-aware access to a method/getter on Object (e.g. `toString()`).

- Null-aware access to a method/getter supplied by an extension that
  extends a nullable type (either explicitly or implicitly).

Change-Id: I46aeb6ffc35fc776f48bcd838ff8e4acf7b39f05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162629
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-09-14 19:53:37 +00:00
Robert Nystrom df9200ec27 Test the runtime checks in mixed-mode programs for unreachable code.
Change-Id: I83a5dd939fb9e7165e72d4e254aa87d17d38eee4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159200
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-08-24 22:31:07 +00:00