| ... | @@ -20203,7 +20203,9 @@ fn unionFieldPtr( | ... | @@ -20203,7 +20203,9 @@ fn unionFieldPtr( |
| 20203 | } | 20203 | } |
| 20204 | | 20204 | |
| 20205 | try sema.requireRuntimeBlock(block, src, null); | 20205 | try sema.requireRuntimeBlock(block, src, null); |
| 20206 | if (!initializing and union_obj.layout == .Auto and block.wantSafety() and union_ty.unionTagTypeSafety() != null) { | 20206 | if (!initializing and union_obj.layout == .Auto and block.wantSafety() and |
| | 20207 | union_ty.unionTagTypeSafety() != null and union_obj.fields.count() > 1) |
| | 20208 | { |
| 20207 | const enum_ty = union_ty.unionTagTypeHypothetical(); | 20209 | const enum_ty = union_ty.unionTagTypeHypothetical(); |
| 20208 | const wanted_tag_val = try Value.Tag.enum_field_index.create(sema.arena, field_index); | 20210 | const wanted_tag_val = try Value.Tag.enum_field_index.create(sema.arena, field_index); |
| 20209 | const wanted_tag = try sema.addConstant(enum_ty, wanted_tag_val); | 20211 | const wanted_tag = try sema.addConstant(enum_ty, wanted_tag_val); |
| ... | @@ -20271,7 +20273,9 @@ fn unionFieldVal( | ... | @@ -20271,7 +20273,9 @@ fn unionFieldVal( |
| 20271 | } | 20273 | } |
| 20272 | | 20274 | |
| 20273 | try sema.requireRuntimeBlock(block, src, null); | 20275 | try sema.requireRuntimeBlock(block, src, null); |
| 20274 | if (union_obj.layout == .Auto and block.wantSafety() and union_ty.unionTagTypeSafety() != null) { | 20276 | if (union_obj.layout == .Auto and block.wantSafety() and |
| | 20277 | union_ty.unionTagTypeSafety() != null and union_obj.fields.count() > 1) |
| | 20278 | { |
| 20275 | const enum_ty = union_ty.unionTagTypeHypothetical(); | 20279 | const enum_ty = union_ty.unionTagTypeHypothetical(); |
| 20276 | const wanted_tag_val = try Value.Tag.enum_field_index.create(sema.arena, field_index); | 20280 | const wanted_tag_val = try Value.Tag.enum_field_index.create(sema.arena, field_index); |
| 20277 | const wanted_tag = try sema.addConstant(enum_ty, wanted_tag_val); | 20281 | const wanted_tag = try sema.addConstant(enum_ty, wanted_tag_val); |