Skip to content

Commit 1325165

Browse files
stereotype441commit-bot@chromium.org
authored andcommitted
Fix compile errors in flow analysis and type promotion test cases.
Change-Id: I4c16ddfeec8598bb07b8c1e44e914424da7199aa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108263 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 14ccc77 commit 1325165

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/analyzer/test/src/dart/resolution/flow_analysis_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ void f() { // f
433433
await trackCode(r'''
434434
void f(bool b, int i) { // f
435435
return;
436+
Object _;
436437
do {} while (b);
437438
for (;;) {}
438439
for (_ in []) {}
@@ -444,6 +445,7 @@ void f(bool b, int i) { // f
444445
''');
445446
verify(
446447
unreachableStatements: [
448+
'Object _',
447449
'do {}',
448450
'for (;;',
449451
'for (_',
@@ -489,6 +491,7 @@ void f() { // f
489491
test_forEach() async {
490492
await trackCode(r'''
491493
void f() {
494+
Object _;
492495
for (_ in [0, 1, 2]) {
493496
1;
494497
return;

pkg/analyzer/test/src/dart/resolution/type_promotion_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ void f(bool b, Object x) {
261261
test_forEach_outerIsType_loopAssigned() async {
262262
await resolveCode(r'''
263263
void f(Object x) {
264+
Object v1;
264265
if (x is String) {
265266
for (var _ in (v1 = [0, 1, 2])) {
266267
x; // 1

0 commit comments

Comments
 (0)