| ... | @@ -7509,12 +7509,15 @@ fn instantiateGenericCall( | ... | @@ -7509,12 +7509,15 @@ fn instantiateGenericCall( |
| 7509 | }; | 7509 | }; |
| 7510 | defer child_sema.deinit(); | 7510 | defer child_sema.deinit(); |
| 7511 | | 7511 | |
| | 7512 | var wip_captures = try WipCaptureScope.init(gpa, sema.owner_decl.src_scope); |
| | 7513 | defer wip_captures.deinit(); |
| | 7514 | |
| 7512 | var child_block: Block = .{ | 7515 | var child_block: Block = .{ |
| 7513 | .parent = null, | 7516 | .parent = null, |
| 7514 | .sema = &child_sema, | 7517 | .sema = &child_sema, |
| 7515 | .src_decl = generic_owner_func.owner_decl, | 7518 | .src_decl = generic_owner_func.owner_decl, |
| 7516 | .namespace = namespace_index, | 7519 | .namespace = namespace_index, |
| 7517 | .wip_capture_scope = block.wip_capture_scope, | 7520 | .wip_capture_scope = wip_captures.scope, |
| 7518 | .instructions = .{}, | 7521 | .instructions = .{}, |
| 7519 | .inlining = null, | 7522 | .inlining = null, |
| 7520 | .is_comptime = true, | 7523 | .is_comptime = true, |
| ... | @@ -7551,6 +7554,8 @@ fn instantiateGenericCall( | ... | @@ -7551,6 +7554,8 @@ fn instantiateGenericCall( |
| 7551 | const func_ty = callee.ty.toType(); | 7554 | const func_ty = callee.ty.toType(); |
| 7552 | const func_ty_info = mod.typeToFunc(func_ty).?; | 7555 | const func_ty_info = mod.typeToFunc(func_ty).?; |
| 7553 | | 7556 | |
| | 7557 | try wip_captures.finalize(); |
| | 7558 | |
| 7554 | // If the call evaluated to a return type that requires comptime, never mind | 7559 | // If the call evaluated to a return type that requires comptime, never mind |
| 7555 | // our generic instantiation. Instead we need to perform a comptime call. | 7560 | // our generic instantiation. Instead we need to perform a comptime call. |
| 7556 | if (try sema.typeRequiresComptime(func_ty_info.return_type.toType())) { | 7561 | if (try sema.typeRequiresComptime(func_ty_info.return_type.toType())) { |