@@ -12,18 +12,18 @@ void variable_if_null_assign_reachable(int? i) {
12
12
13
13
void variable_if_null_unreachable (int i) {
14
14
// Reachable since the value of i might come from legacy code
15
- i ?? 0 ;
15
+ i ?? /*unreachable*/ 0 ;
16
16
}
17
17
18
18
void variable_if_null_assign_unreachable (int i) {
19
19
// Reachable since the value of i might come from legacy code
20
- i ?? = 0 ;
20
+ /*cfe.update: unreachable*/ i ?? = /*unreachable*/ 0 ;
21
21
}
22
22
23
23
void variable_if_null_assign_unreachable_due_to_promotion (int ? i) {
24
24
if (i == null ) return ;
25
25
// Reachable since the value of i might come from legacy code
26
- i ?? = 0 ;
26
+ /*cfe.update: unreachable*/ i ?? = /*unreachable*/ 0 ;
27
27
}
28
28
29
29
/*member: topLevelNullable:doesNotComplete*/
@@ -45,13 +45,13 @@ void top_level_if_null_assign_reachable() {
45
45
void top_level_if_null_unreachable () {
46
46
// Reachable since the value returned by topLevelNonNullGet might come from
47
47
// legacy code
48
- topLevelNonNullGet ?? 0 ;
48
+ topLevelNonNullGet ?? /*unreachable*/ 0 ;
49
49
}
50
50
51
51
void top_level_if_null_assign_unreachable () {
52
52
// Reachable since the value returned by topLevelNonNullGet might come from
53
53
// legacy code
54
- topLevelNonNullGet ?? = 0 ;
54
+ topLevelNonNullGet /*cfe.update: unreachable*/ ?? = /*unreachable*/ 0 ;
55
55
}
56
56
57
57
class HasProperty <T > {
@@ -70,12 +70,12 @@ void property_if_null_assign_reachable(HasProperty<int?> x) {
70
70
71
71
void property_if_null_unreachable (HasProperty <int > x) {
72
72
// Reachable since the value returned by prop might come from legacy code
73
- x.prop ?? 0 ;
73
+ x.prop ?? /*unreachable*/ 0 ;
74
74
}
75
75
76
76
void property_if_null_assign_unreachable (HasProperty <int > x) {
77
77
// Reachable since the value returned by prop might come from legacy code
78
- x.prop ?? = 0 ;
78
+ x.prop ?? = /*unreachable*/ 0 ;
79
79
}
80
80
81
81
void null_aware_property_if_null_reachable (HasProperty <int ?>? x) {
@@ -94,7 +94,7 @@ void null_aware_property_if_null_not_shortened(HasProperty<int>? x) {
94
94
95
95
void null_aware_property_if_null_assign_unreachable (HasProperty <int >? x) {
96
96
// Reachable since the value returned by prop might come from legacy code.
97
- x? .prop ?? = 0 ;
97
+ x? .prop ?? = /*unreachable*/ 0 ;
98
98
}
99
99
100
100
class SuperIntQuestionProperty extends HasProperty <int ?> {
@@ -110,12 +110,12 @@ class SuperIntQuestionProperty extends HasProperty<int?> {
110
110
class SuperIntProperty extends HasProperty <int > {
111
111
void if_null_unreachable () {
112
112
// Reachable since the value returned by prop might come from legacy code.
113
- super .prop ?? 0 ;
113
+ super .prop ?? /*unreachable*/ 0 ;
114
114
}
115
115
116
116
void if_null_assign_unreachable () {
117
117
// Reachable since the value returned by prop might come from legacy code.
118
- super .prop ?? = 0 ;
118
+ super .prop ?? = /*unreachable*/ 0 ;
119
119
}
120
120
}
121
121
@@ -138,13 +138,13 @@ void extended_property_if_null_assign_reachable(HasProperty<int?> x) {
138
138
void extended_property_if_null_unreachable (HasProperty <int > x) {
139
139
// Reachable since the value returned by extendedProp might come from legacy
140
140
// code.
141
- x.extendedProp ?? 0 ;
141
+ x.extendedProp ?? /*unreachable*/ 0 ;
142
142
}
143
143
144
144
void extended_property_if_null_assign_unreachable (HasProperty <int > x) {
145
145
// Reachable since the value returned by extendedProp might come from legacy
146
146
// code.
147
- x.extendedProp ?? = 0 ;
147
+ x.extendedProp ?? = /*unreachable*/ 0 ;
148
148
}
149
149
150
150
void null_aware_extended_property_if_null_reachable (HasProperty <int ?>? x) {
@@ -166,7 +166,7 @@ void null_aware_extended_property_if_null_assign_unreachable(
166
166
HasProperty <int >? x) {
167
167
// Reachable since the value returned by extendedProp might come from legacy
168
168
// code.
169
- x? .extendedProp ?? = 0 ;
169
+ x? .extendedProp ?? = /*unreachable*/ 0 ;
170
170
}
171
171
172
172
void explicit_extended_property_if_null_reachable (HasProperty <int ?> x) {
@@ -180,13 +180,13 @@ void explicit_extended_property_if_null_assign_reachable(HasProperty<int?> x) {
180
180
void explicit_extended_property_if_null_unreachable (HasProperty <int > x) {
181
181
// Reachable since the value returned by extendedProp might come from legacy
182
182
// code.
183
- ExtensionProperty (x).extendedProp ?? 0 ;
183
+ ExtensionProperty (x).extendedProp ?? /*unreachable*/ 0 ;
184
184
}
185
185
186
186
void explicit_extended_property_if_null_assign_unreachable (HasProperty <int > x) {
187
187
// Reachable since the value returned by extendedProp might come from legacy
188
188
// code.
189
- ExtensionProperty (x).extendedProp ?? = 0 ;
189
+ ExtensionProperty (x).extendedProp ?? = /*unreachable*/ 0 ;
190
190
}
191
191
192
192
void null_aware_explicit_extended_property_if_null_reachable (
@@ -210,7 +210,7 @@ void null_aware_explicit_extended_property_if_null_assign_unreachable(
210
210
HasProperty <int >? x) {
211
211
// Reachable since the value returned by extendedProp might come from legacy
212
212
// code.
213
- ExtensionProperty (x)? .extendedProp ?? = 0 ;
213
+ ExtensionProperty (x)? .extendedProp ?? = /*unreachable*/ 0 ;
214
214
}
215
215
216
216
class Indexable <T > {
@@ -226,7 +226,7 @@ void index_if_null_reachable(Indexable<int?> x) {
226
226
void index_if_null_unreachable (Indexable <int > x) {
227
227
// Reachable since the value returned by operator[] might come from legacy
228
228
// code.
229
- x[0 ] ?? 0 ;
229
+ x[0 ] ?? /*unreachable*/ 0 ;
230
230
}
231
231
232
232
void index_if_null_assign_reachable (Indexable <int ?> x) {
@@ -236,7 +236,7 @@ void index_if_null_assign_reachable(Indexable<int?> x) {
236
236
void index_if_null_assign_unreachable (Indexable <int > x) {
237
237
// Reachable since the value returned by operator[] might come from legacy
238
238
// code.
239
- x[0 ] ?? = 0 ;
239
+ x[0 ] ?? = /*unreachable*/ 0 ;
240
240
}
241
241
242
242
void null_aware_index_if_null_reachable (Indexable <int ?>? x) {
@@ -256,7 +256,7 @@ void null_aware_index_if_null_assign_reachable(Indexable<int?>? x) {
256
256
void null_aware_index_if_null_assign_unreachable (Indexable <int >? x) {
257
257
// Reachable since the value returned by operator[] might come from legacy
258
258
// code.
259
- x? [0 ] ?? = 0 ;
259
+ x? [0 ] ?? = /*unreachable*/ 0 ;
260
260
}
261
261
262
262
class SuperIntQuestionIndex extends Indexable <int ?> {
@@ -273,13 +273,13 @@ class SuperIntIndex extends Indexable<int> {
273
273
void if_null_unreachable () {
274
274
// Reachable since the value returned by operator[] might come from legacy
275
275
// code.
276
- super [0 ] ?? 0 ;
276
+ super [0 ] ?? /*unreachable*/ 0 ;
277
277
}
278
278
279
279
void if_null_assign_unreachable () {
280
280
// Reachable since the value returned by operator[] might come from legacy
281
281
// code.
282
- super [0 ] ?? = 0 ;
282
+ super [0 ] ?? = /*unreachable*/ 0 ;
283
283
}
284
284
}
285
285
@@ -302,13 +302,13 @@ void extended_index_if_null_assign_reachable(HasProperty<int?> x) {
302
302
void extended_index_if_null_unreachable (HasProperty <int > x) {
303
303
// Reachable since the value returned by operator[] might come from legacy
304
304
// code.
305
- x[0 ] ?? 0 ;
305
+ x[0 ] ?? /*unreachable*/ 0 ;
306
306
}
307
307
308
308
void extended_index_if_null_assign_unreachable (HasProperty <int > x) {
309
309
// Reachable since the value returned by operator[] might come from legacy
310
310
// code.
311
- x[0 ] ?? = 0 ;
311
+ x[0 ] ?? = /*unreachable*/ 0 ;
312
312
}
313
313
314
314
void null_aware_extended_index_if_null_reachable (HasProperty <int ?>? x) {
@@ -328,7 +328,7 @@ void null_aware_extended_index_if_null_not_shortened(HasProperty<int>? x) {
328
328
void null_aware_extended_index_if_null_assign_unreachable (HasProperty <int >? x) {
329
329
// Reachable since the value returned by operator[] might come from legacy
330
330
// code.
331
- x? [0 ] ?? = 0 ;
331
+ x? [0 ] ?? = /*unreachable*/ 0 ;
332
332
}
333
333
334
334
void explicit_extended_index_if_null_reachable (HasProperty <int ?> x) {
@@ -342,13 +342,13 @@ void explicit_extended_index_if_null_assign_reachable(HasProperty<int?> x) {
342
342
void explicit_extended_index_if_null_unreachable (HasProperty <int > x) {
343
343
// Reachable since the value returned by operator[] might come from legacy
344
344
// code.
345
- ExtensionIndex (x)[0 ] ?? 0 ;
345
+ ExtensionIndex (x)[0 ] ?? /*unreachable*/ 0 ;
346
346
}
347
347
348
348
void explicit_extended_index_if_null_assign_unreachable (HasProperty <int > x) {
349
349
// Reachable since the value returned by operator[] might come from legacy
350
350
// code.
351
- ExtensionIndex (x)[0 ] ?? = 0 ;
351
+ ExtensionIndex (x)[0 ] ?? = /*unreachable*/ 0 ;
352
352
}
353
353
354
354
void null_aware_explicit_extended_index_if_null_reachable (
@@ -372,5 +372,5 @@ void null_aware_explicit_extended_index_if_null_assign_unreachable(
372
372
HasProperty <int >? x) {
373
373
// Reachable since the value returned by operator[] might come from legacy
374
374
// code.
375
- ExtensionIndex (x)? [0 ] ?? = 0 ;
375
+ ExtensionIndex (x)? [0 ] ?? = /*unreachable*/ 0 ;
376
376
}
0 commit comments