@@ -12,18 +12,18 @@ void variable_if_null_assign_reachable(int? i) {
1212
1313void variable_if_null_unreachable (int i) {
1414 // Reachable since the value of i might come from legacy code
15- i ?? 0 ;
15+ i ?? /*unreachable*/ 0 ;
1616}
1717
1818void variable_if_null_assign_unreachable (int i) {
1919 // Reachable since the value of i might come from legacy code
20- i ?? = 0 ;
20+ /*cfe.update: unreachable*/ i ?? = /*unreachable*/ 0 ;
2121}
2222
2323void variable_if_null_assign_unreachable_due_to_promotion (int ? i) {
2424 if (i == null ) return ;
2525 // Reachable since the value of i might come from legacy code
26- i ?? = 0 ;
26+ /*cfe.update: unreachable*/ i ?? = /*unreachable*/ 0 ;
2727}
2828
2929/*member: topLevelNullable:doesNotComplete*/
@@ -45,13 +45,13 @@ void top_level_if_null_assign_reachable() {
4545void top_level_if_null_unreachable () {
4646 // Reachable since the value returned by topLevelNonNullGet might come from
4747 // legacy code
48- topLevelNonNullGet ?? 0 ;
48+ topLevelNonNullGet ?? /*unreachable*/ 0 ;
4949}
5050
5151void top_level_if_null_assign_unreachable () {
5252 // Reachable since the value returned by topLevelNonNullGet might come from
5353 // legacy code
54- topLevelNonNullGet ?? = 0 ;
54+ topLevelNonNullGet /*cfe.update: unreachable*/ ?? = /*unreachable*/ 0 ;
5555}
5656
5757class HasProperty <T > {
@@ -70,12 +70,12 @@ void property_if_null_assign_reachable(HasProperty<int?> x) {
7070
7171void property_if_null_unreachable (HasProperty <int > x) {
7272 // Reachable since the value returned by prop might come from legacy code
73- x.prop ?? 0 ;
73+ x.prop ?? /*unreachable*/ 0 ;
7474}
7575
7676void property_if_null_assign_unreachable (HasProperty <int > x) {
7777 // Reachable since the value returned by prop might come from legacy code
78- x.prop ?? = 0 ;
78+ x.prop ?? = /*unreachable*/ 0 ;
7979}
8080
8181void null_aware_property_if_null_reachable (HasProperty <int ?>? x) {
@@ -94,7 +94,7 @@ void null_aware_property_if_null_not_shortened(HasProperty<int>? x) {
9494
9595void null_aware_property_if_null_assign_unreachable (HasProperty <int >? x) {
9696 // Reachable since the value returned by prop might come from legacy code.
97- x? .prop ?? = 0 ;
97+ x? .prop ?? = /*unreachable*/ 0 ;
9898}
9999
100100class SuperIntQuestionProperty extends HasProperty <int ?> {
@@ -110,12 +110,12 @@ class SuperIntQuestionProperty extends HasProperty<int?> {
110110class SuperIntProperty extends HasProperty <int > {
111111 void if_null_unreachable () {
112112 // Reachable since the value returned by prop might come from legacy code.
113- super .prop ?? 0 ;
113+ super .prop ?? /*unreachable*/ 0 ;
114114 }
115115
116116 void if_null_assign_unreachable () {
117117 // Reachable since the value returned by prop might come from legacy code.
118- super .prop ?? = 0 ;
118+ super .prop ?? = /*unreachable*/ 0 ;
119119 }
120120}
121121
@@ -138,13 +138,13 @@ void extended_property_if_null_assign_reachable(HasProperty<int?> x) {
138138void extended_property_if_null_unreachable (HasProperty <int > x) {
139139 // Reachable since the value returned by extendedProp might come from legacy
140140 // code.
141- x.extendedProp ?? 0 ;
141+ x.extendedProp ?? /*unreachable*/ 0 ;
142142}
143143
144144void extended_property_if_null_assign_unreachable (HasProperty <int > x) {
145145 // Reachable since the value returned by extendedProp might come from legacy
146146 // code.
147- x.extendedProp ?? = 0 ;
147+ x.extendedProp ?? = /*unreachable*/ 0 ;
148148}
149149
150150void null_aware_extended_property_if_null_reachable (HasProperty <int ?>? x) {
@@ -166,7 +166,7 @@ void null_aware_extended_property_if_null_assign_unreachable(
166166 HasProperty <int >? x) {
167167 // Reachable since the value returned by extendedProp might come from legacy
168168 // code.
169- x? .extendedProp ?? = 0 ;
169+ x? .extendedProp ?? = /*unreachable*/ 0 ;
170170}
171171
172172void explicit_extended_property_if_null_reachable (HasProperty <int ?> x) {
@@ -180,13 +180,13 @@ void explicit_extended_property_if_null_assign_reachable(HasProperty<int?> x) {
180180void explicit_extended_property_if_null_unreachable (HasProperty <int > x) {
181181 // Reachable since the value returned by extendedProp might come from legacy
182182 // code.
183- ExtensionProperty (x).extendedProp ?? 0 ;
183+ ExtensionProperty (x).extendedProp ?? /*unreachable*/ 0 ;
184184}
185185
186186void explicit_extended_property_if_null_assign_unreachable (HasProperty <int > x) {
187187 // Reachable since the value returned by extendedProp might come from legacy
188188 // code.
189- ExtensionProperty (x).extendedProp ?? = 0 ;
189+ ExtensionProperty (x).extendedProp ?? = /*unreachable*/ 0 ;
190190}
191191
192192void null_aware_explicit_extended_property_if_null_reachable (
@@ -210,7 +210,7 @@ void null_aware_explicit_extended_property_if_null_assign_unreachable(
210210 HasProperty <int >? x) {
211211 // Reachable since the value returned by extendedProp might come from legacy
212212 // code.
213- ExtensionProperty (x)? .extendedProp ?? = 0 ;
213+ ExtensionProperty (x)? .extendedProp ?? = /*unreachable*/ 0 ;
214214}
215215
216216class Indexable <T > {
@@ -226,7 +226,7 @@ void index_if_null_reachable(Indexable<int?> x) {
226226void index_if_null_unreachable (Indexable <int > x) {
227227 // Reachable since the value returned by operator[] might come from legacy
228228 // code.
229- x[0 ] ?? 0 ;
229+ x[0 ] ?? /*unreachable*/ 0 ;
230230}
231231
232232void index_if_null_assign_reachable (Indexable <int ?> x) {
@@ -236,7 +236,7 @@ void index_if_null_assign_reachable(Indexable<int?> x) {
236236void index_if_null_assign_unreachable (Indexable <int > x) {
237237 // Reachable since the value returned by operator[] might come from legacy
238238 // code.
239- x[0 ] ?? = 0 ;
239+ x[0 ] ?? = /*unreachable*/ 0 ;
240240}
241241
242242void null_aware_index_if_null_reachable (Indexable <int ?>? x) {
@@ -256,7 +256,7 @@ void null_aware_index_if_null_assign_reachable(Indexable<int?>? x) {
256256void null_aware_index_if_null_assign_unreachable (Indexable <int >? x) {
257257 // Reachable since the value returned by operator[] might come from legacy
258258 // code.
259- x? [0 ] ?? = 0 ;
259+ x? [0 ] ?? = /*unreachable*/ 0 ;
260260}
261261
262262class SuperIntQuestionIndex extends Indexable <int ?> {
@@ -273,13 +273,13 @@ class SuperIntIndex extends Indexable<int> {
273273 void if_null_unreachable () {
274274 // Reachable since the value returned by operator[] might come from legacy
275275 // code.
276- super [0 ] ?? 0 ;
276+ super [0 ] ?? /*unreachable*/ 0 ;
277277 }
278278
279279 void if_null_assign_unreachable () {
280280 // Reachable since the value returned by operator[] might come from legacy
281281 // code.
282- super [0 ] ?? = 0 ;
282+ super [0 ] ?? = /*unreachable*/ 0 ;
283283 }
284284}
285285
@@ -302,13 +302,13 @@ void extended_index_if_null_assign_reachable(HasProperty<int?> x) {
302302void extended_index_if_null_unreachable (HasProperty <int > x) {
303303 // Reachable since the value returned by operator[] might come from legacy
304304 // code.
305- x[0 ] ?? 0 ;
305+ x[0 ] ?? /*unreachable*/ 0 ;
306306}
307307
308308void extended_index_if_null_assign_unreachable (HasProperty <int > x) {
309309 // Reachable since the value returned by operator[] might come from legacy
310310 // code.
311- x[0 ] ?? = 0 ;
311+ x[0 ] ?? = /*unreachable*/ 0 ;
312312}
313313
314314void 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) {
328328void null_aware_extended_index_if_null_assign_unreachable (HasProperty <int >? x) {
329329 // Reachable since the value returned by operator[] might come from legacy
330330 // code.
331- x? [0 ] ?? = 0 ;
331+ x? [0 ] ?? = /*unreachable*/ 0 ;
332332}
333333
334334void explicit_extended_index_if_null_reachable (HasProperty <int ?> x) {
@@ -342,13 +342,13 @@ void explicit_extended_index_if_null_assign_reachable(HasProperty<int?> x) {
342342void explicit_extended_index_if_null_unreachable (HasProperty <int > x) {
343343 // Reachable since the value returned by operator[] might come from legacy
344344 // code.
345- ExtensionIndex (x)[0 ] ?? 0 ;
345+ ExtensionIndex (x)[0 ] ?? /*unreachable*/ 0 ;
346346}
347347
348348void explicit_extended_index_if_null_assign_unreachable (HasProperty <int > x) {
349349 // Reachable since the value returned by operator[] might come from legacy
350350 // code.
351- ExtensionIndex (x)[0 ] ?? = 0 ;
351+ ExtensionIndex (x)[0 ] ?? = /*unreachable*/ 0 ;
352352}
353353
354354void null_aware_explicit_extended_index_if_null_reachable (
@@ -372,5 +372,5 @@ void null_aware_explicit_extended_index_if_null_assign_unreachable(
372372 HasProperty <int >? x) {
373373 // Reachable since the value returned by operator[] might come from legacy
374374 // code.
375- ExtensionIndex (x)? [0 ] ?? = 0 ;
375+ ExtensionIndex (x)? [0 ] ?? = /*unreachable*/ 0 ;
376376}
0 commit comments