You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Front end: Additional "why not promoted" functionality.
This CL implements "why not promoted" functionality in the front end
for the following scenarios:
- null iterable in for-loop
- null iterable in yield* statement
- null iterable or map after spread (`...`) operator
Bug: #44898
Change-Id: I471b8bf558341514207fad527dde009f1372182c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188160
Reviewed-by: Johnni Winther <[email protected]>
Commit-Queue: Paul Berry <[email protected]>
Copy file name to clipboardExpand all lines: pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/for_in_loop_type_not_iterable_nullability_error.dart
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,6 @@
7
7
// `ForInLoopTypeNotIterablePartNullability` errors, for which we wish to report
8
8
// "why not promoted" context information.
9
9
10
-
// TODO(paulberry): get this to work with the CFE and add additional test cases
11
-
// if needed.
12
-
13
10
classC1 {
14
11
List<int>? bad;
15
12
}
@@ -18,5 +15,5 @@ test(C1 c) {
18
15
if (c.bad ==null) return;
19
16
for (var x
20
17
in/*analyzer.notPromoted(propertyNotPromoted(target: member:C1.bad, type: List<int>?))*/ c
Copy file name to clipboardExpand all lines: pkg/_fe_analyzer_shared/test/flow_analysis/why_not_promoted/data/invalid_assignment_error_nullability_error.dart
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,12 @@
7
7
// `InvalidAssignmentErrorPartNullability` errors, for which we wish to report
8
8
// "why not promoted" context information.
9
9
10
-
// TODO(paulberry): get this to work with the CFE and add additional test cases
11
-
// if needed.
12
-
13
10
classC1 {
14
11
List<int>? bad;
15
12
}
16
13
17
14
test(C1 c) sync* {
18
15
if (c.bad ==null) return;
19
16
yield*/*analyzer.notPromoted(propertyNotPromoted(target: member:C1.bad, type: List<int>?))*/ c
0 commit comments