Skip to content

Commit b6fbee2

Browse files
stereotype441commit-bot@chromium.org
authored andcommitted
Flow analysis: additional "why not promoted" test cases.
These test cases already work properly, but they weren't previously covered by tests. Bug: #44898 Change-Id: I4fc6506230af203a361631afc542e0db08bd6f27 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196106 Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent ba3e7a6 commit b6fbee2

File tree

2 files changed

+225
-167
lines changed

2 files changed

+225
-167
lines changed

pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/argument_type_not_assignable_nullability_error.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,26 @@ explicitExtensionInvocation(C33 c) {
452452
/*notPromoted(propertyNotPromoted(target: member:C33.bad, type: int?))*/ bad)
453453
.f();
454454
}
455+
456+
class C34 {
457+
int? bad;
458+
C34(int value);
459+
}
460+
461+
class D34 extends C34 {
462+
int other;
463+
D34(C34 c)
464+
: other = c.bad!,
465+
super(c.
466+
/*notPromoted(propertyNotPromoted(target: member:C34.bad, type: int?))*/ bad);
467+
}
468+
469+
class C35 {
470+
int? bad;
471+
}
472+
473+
indexSetRhs(C35 c, List<int> x) {
474+
if (c.bad == null) return;
475+
x[0] = c.
476+
/*notPromoted(propertyNotPromoted(target: member:C35.bad, type: int?))*/ bad;
477+
}

0 commit comments

Comments
 (0)