File tree Expand file tree Collapse file tree 2 files changed +92
-2
lines changed Expand file tree Collapse file tree 2 files changed +92
-2
lines changed Original file line number Diff line number Diff line change 12
12
/// detects assignment in `S` .
13
13
14
14
15
- main () {
15
+ class C {
16
+ int v;
17
+ C (this .v);
18
+ }
19
+
20
+ test1 () {
16
21
try {
17
22
late int i;
18
23
while (1 > 2 ) {
@@ -21,3 +26,40 @@ main() {
21
26
i; // Not definitely unassigned
22
27
} catch (_) {}
23
28
}
29
+
30
+ test2 () {
31
+ try {
32
+ late int i;
33
+ while (1 > 2 ) {
34
+ (i,) = (42 ,);
35
+ }
36
+ i; // Not definitely unassigned
37
+ } catch (_) {}
38
+ }
39
+
40
+ test3 () {
41
+ try {
42
+ late int i;
43
+ while (1 > 2 ) {
44
+ (x: i) = (x: 42 );
45
+ }
46
+ i; // Not definitely unassigned
47
+ } catch (_) {}
48
+ }
49
+
50
+ test4 () {
51
+ try {
52
+ late int i;
53
+ while (1 > 2 ) {
54
+ C (v: i) = C (42 );
55
+ }
56
+ i; // Not definitely unassigned
57
+ } catch (_) {}
58
+ }
59
+
60
+ main () {
61
+ test1 ();
62
+ test2 ();
63
+ test3 ();
64
+ test4 ();
65
+ }
Original file line number Diff line number Diff line change 12
12
/// detects assignment in `S` .
13
13
14
14
15
- main () {
15
+ class C {
16
+ int v;
17
+ C (this .v);
18
+ }
19
+
20
+ test1 () {
16
21
try {
17
22
late int i;
18
23
while (1 > 2 ) {
@@ -23,3 +28,46 @@ main() {
23
28
i; // Not definitely unassigned
24
29
} catch (_) {}
25
30
}
31
+
32
+ test2 () {
33
+ try {
34
+ late int i;
35
+ while (1 > 2 ) {
36
+ () {
37
+ (i,) = (42 ,);
38
+ };
39
+ }
40
+ i; // Not definitely unassigned
41
+ } catch (_) {}
42
+ }
43
+
44
+ test3 () {
45
+ try {
46
+ late int i;
47
+ while (1 > 2 ) {
48
+ () {
49
+ (x: i) = (x: 42 );
50
+ };
51
+ }
52
+ i; // Not definitely unassigned
53
+ } catch (_) {}
54
+ }
55
+
56
+ test4 () {
57
+ try {
58
+ late int i;
59
+ while (1 > 2 ) {
60
+ () {
61
+ C (v: i) = C (42 );
62
+ };
63
+ }
64
+ i; // Not definitely unassigned
65
+ } catch (_) {}
66
+ }
67
+
68
+ main () {
69
+ test1 ();
70
+ test2 ();
71
+ test3 ();
72
+ test4 ();
73
+ }
You can’t perform that action at this time.
0 commit comments