Skip to content

#3057. Expect error in reachability_for_A03_t05.dart test. #3132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions TypeSystem/flow-analysis/reachability_for_A03_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,30 @@
/// - Let `after(N) = inheritTested(join(false(C), unsplit(break(S))), after(U))`
///
/// @description Checks that `before(U) = merge(after(S), continue(S))`. Test
/// that if `D`, `C` and `S` are empty then an assignment in `U` is a definite
/// assignment.
/// that if `D`, `C` and `S` are empty then an assignment in `U` is treated as a
/// "possibly assigned".
/// @author [email protected]
/// @issue 60320

test1() {
int i;
for (;; i = 42) {
}
i; // Dead code but definitely assigned.
i; // Possibly assigned. See https://github.com/dart-lang/sdk/issues/60320#issuecomment-2776599140
//^
// [analyzer] unspecified
// [cfe] unspecified
}

test2() {
int i;
[
for (;; i = 42) 0
];
i; // Dead code but definitely assigned.
i;
//^
// [analyzer] unspecified
// [cfe] unspecified
}

test3() {
Expand All @@ -37,7 +43,10 @@ test3() {
for (;; i = 42)
0: 0
};
i; // Dead code but definitely assigned.
i;
//^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
Expand Down
2 changes: 1 addition & 1 deletion TypeSystem/flow-analysis/reachability_for_A03_t06.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

main() {
late int i;
for (;; i = 42) { // Possibly assigned. https://github.com/dart-lang/sdk/issues/42232#issuecomment-690681385
for (;; i = 42) { // Possibly assigned. https://github.com/dart-lang/sdk/issues/60320#issuecomment-2776599140
break;
}
try {
Expand Down