Skip to content

Commit

Permalink
[ddc] Opt code in nullable inference test
Browse files Browse the repository at this point in the history
Avoids breaks that appear when enabling the `nnbd` experiment
by default as seen in:
https://dart-review.googlesource.com/c/sdk/+/166790

Change-Id: Idaf69b40c27336c8601cb143741f79604d2647e7
Fixes: #43843
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168583
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
  • Loading branch information
nshahan authored and commit-bot@chromium.org committed Oct 20, 2020
1 parent e2840ed commit f990e70
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/dev_compiler/test/nullable_inference_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ void main() {
/// to be produced in the set of expressions that cannot be null by DDC's null
/// inference.
Future expectNotNull(String code, String expectedNotNull) async {
code = '// @dart = 2.9\n$code';
var result = await kernelCompile(code);
var collector = NotNullCollector(result.librariesFromDill);
result.component.accept(collector);
Expand Down Expand Up @@ -525,6 +526,7 @@ Future expectNotNull(String code, String expectedNotNull) async {

/// Given the Dart [code], expects all the expressions inferred to be not-null.
Future expectAllNotNull(String code) async {
code = '// @dart = 2.9\n$code';
var result = (await kernelCompile(code));
result.component.accept(ExpectAllNotNull(result.librariesFromDill));
}
Expand Down

0 comments on commit f990e70

Please sign in to comment.