| ... | @@ -24206,7 +24206,10 @@ fn coerceExtra( | ... | @@ -24206,7 +24206,10 @@ fn coerceExtra( |
| 24206 | inst_ty.childType().isAnonStruct() and | 24206 | inst_ty.childType().isAnonStruct() and |
| 24207 | sema.checkPtrAttributes(dest_ty, inst_ty, &in_memory_result)) | 24207 | sema.checkPtrAttributes(dest_ty, inst_ty, &in_memory_result)) |
| 24208 | { | 24208 | { |
| 24209 | return sema.coerceAnonStructToStructPtrs(block, dest_ty, dest_ty_src, inst, inst_src); | 24209 | return sema.coerceAnonStructToStructPtrs(block, dest_ty, dest_ty_src, inst, inst_src) catch |err| switch (err) { |
| | 24210 | error.NotCoercible => break :pointer, |
| | 24211 | else => |e| return e, |
| | 24212 | }; |
| 24210 | } | 24213 | } |
| 24211 | }, | 24214 | }, |
| 24212 | .Array => { | 24215 | .Array => { |
| ... | @@ -24519,12 +24522,15 @@ fn coerceExtra( | ... | @@ -24519,12 +24522,15 @@ fn coerceExtra( |
| 24519 | }, | 24522 | }, |
| 24520 | else => {}, | 24523 | else => {}, |
| 24521 | }, | 24524 | }, |
| 24522 | .Struct => { | 24525 | .Struct => blk: { |
| 24523 | if (inst == .empty_struct) { | 24526 | if (inst == .empty_struct) { |
| 24524 | return sema.structInitEmpty(block, dest_ty, dest_ty_src, inst_src); | 24527 | return sema.structInitEmpty(block, dest_ty, dest_ty_src, inst_src); |
| 24525 | } | 24528 | } |
| 24526 | if (inst_ty.isTupleOrAnonStruct()) { | 24529 | if (inst_ty.isTupleOrAnonStruct()) { |
| 24527 | return sema.coerceTupleToStruct(block, dest_ty, inst, inst_src); | 24530 | return sema.coerceTupleToStruct(block, dest_ty, inst, inst_src) catch |err| switch (err) { |
| | 24531 | error.NotCoercible => break :blk, |
| | 24532 | else => |e| return e, |
| | 24533 | }; |
| 24528 | } | 24534 | } |
| 24529 | }, | 24535 | }, |
| 24530 | else => {}, | 24536 | else => {}, |
| ... | @@ -27215,6 +27221,8 @@ fn coerceTupleToTuple( | ... | @@ -27215,6 +27221,8 @@ fn coerceTupleToTuple( |
| 27215 | | 27221 | |
| 27216 | const inst_ty = sema.typeOf(inst); | 27222 | const inst_ty = sema.typeOf(inst); |
| 27217 | const inst_field_count = inst_ty.structFieldCount(); | 27223 | const inst_field_count = inst_ty.structFieldCount(); |
| | 27224 | if (inst_field_count > dest_field_count) return error.NotCoercible; |
| | 27225 | |
| 27218 | var runtime_src: ?LazySrcLoc = null; | 27226 | var runtime_src: ?LazySrcLoc = null; |
| 27219 | var field_i: u32 = 0; | 27227 | var field_i: u32 = 0; |
| 27220 | while (field_i < inst_field_count) : (field_i += 1) { | 27228 | while (field_i < inst_field_count) : (field_i += 1) { |