| ... | @@ -27498,17 +27498,20 @@ fn coerceInMemoryAllowedFns( | ... | @@ -27498,17 +27498,20 @@ fn coerceInMemoryAllowedFns( |
| 27498 | } }; | 27498 | } }; |
| 27499 | } | 27499 | } |
| 27500 | | 27500 | |
| 27501 | if (src_info.return_type != .noreturn_type) { | 27501 | switch (src_info.return_type) { |
| 27502 | const dest_return_type = dest_info.return_type.toType(); | 27502 | .noreturn_type, .generic_poison_type => {}, |
| 27503 | const src_return_type = src_info.return_type.toType(); | 27503 | else => { |
| 27504 | const rt = try sema.coerceInMemoryAllowed(block, dest_return_type, src_return_type, false, target, dest_src, src_src); | 27504 | const dest_return_type = dest_info.return_type.toType(); |
| 27505 | if (rt != .ok) { | 27505 | const src_return_type = src_info.return_type.toType(); |
| 27506 | return InMemoryCoercionResult{ .fn_return_type = .{ | 27506 | const rt = try sema.coerceInMemoryAllowed(block, dest_return_type, src_return_type, false, target, dest_src, src_src); |
| 27507 | .child = try rt.dupe(sema.arena), | 27507 | if (rt != .ok) { |
| 27508 | .actual = dest_return_type, | 27508 | return InMemoryCoercionResult{ .fn_return_type = .{ |
| 27509 | .wanted = src_return_type, | 27509 | .child = try rt.dupe(sema.arena), |
| 27510 | } }; | 27510 | .actual = dest_return_type, |
| 27511 | } | 27511 | .wanted = src_return_type, |
| | 27512 | } }; |
| | 27513 | } |
| | 27514 | }, |
| 27512 | } | 27515 | } |
| 27513 | } | 27516 | } |
| 27514 | | 27517 | |
| ... | @@ -27548,15 +27551,20 @@ fn coerceInMemoryAllowedFns( | ... | @@ -27548,15 +27551,20 @@ fn coerceInMemoryAllowedFns( |
| 27548 | } }; | 27551 | } }; |
| 27549 | } | 27552 | } |
| 27550 | | 27553 | |
| 27551 | // Note: Cast direction is reversed here. | 27554 | switch (src_param_ty.toIntern()) { |
| 27552 | const param = try sema.coerceInMemoryAllowed(block, src_param_ty, dest_param_ty, false, target, dest_src, src_src); | 27555 | .generic_poison_type => {}, |
| 27553 | if (param != .ok) { | 27556 | else => { |
| 27554 | return InMemoryCoercionResult{ .fn_param = .{ | 27557 | // Note: Cast direction is reversed here. |
| 27555 | .child = try param.dupe(sema.arena), | 27558 | const param = try sema.coerceInMemoryAllowed(block, src_param_ty, dest_param_ty, false, target, dest_src, src_src); |
| 27556 | .actual = src_param_ty, | 27559 | if (param != .ok) { |
| 27557 | .wanted = dest_param_ty, | 27560 | return InMemoryCoercionResult{ .fn_param = .{ |
| 27558 | .index = param_i, | 27561 | .child = try param.dupe(sema.arena), |
| 27559 | } }; | 27562 | .actual = src_param_ty, |
| | 27563 | .wanted = dest_param_ty, |
| | 27564 | .index = param_i, |
| | 27565 | } }; |
| | 27566 | } |
| | 27567 | }, |
| 27560 | } | 27568 | } |
| 27561 | } | 27569 | } |
| 27562 | | 27570 | |