| ... | @@ -7685,8 +7685,7 @@ fn instantiateGenericCall( | ... | @@ -7685,8 +7685,7 @@ fn instantiateGenericCall( |
| 7685 | // Make a runtime call to the new function, making sure to omit the comptime args. | 7685 | // Make a runtime call to the new function, making sure to omit the comptime args. |
| 7686 | const comptime_args = callee.comptime_args.?; | 7686 | const comptime_args = callee.comptime_args.?; |
| 7687 | const func_ty = mod.declPtr(callee.owner_decl).ty; | 7687 | const func_ty = mod.declPtr(callee.owner_decl).ty; |
| 7688 | const new_fn_info = mod.typeToFunc(func_ty).?; | 7688 | const runtime_args_len = @intCast(u32, mod.typeToFunc(func_ty).?.param_types.len); |
| 7689 | const runtime_args_len = @intCast(u32, new_fn_info.param_types.len); | | |
| 7690 | const runtime_args = try sema.arena.alloc(Air.Inst.Ref, runtime_args_len); | 7689 | const runtime_args = try sema.arena.alloc(Air.Inst.Ref, runtime_args_len); |
| 7691 | { | 7690 | { |
| 7692 | var runtime_i: u32 = 0; | 7691 | var runtime_i: u32 = 0; |
| ... | @@ -7702,7 +7701,7 @@ fn instantiateGenericCall( | ... | @@ -7702,7 +7701,7 @@ fn instantiateGenericCall( |
| 7702 | uncasted_args[total_i], | 7701 | uncasted_args[total_i], |
| 7703 | comptime_args[total_i], | 7702 | comptime_args[total_i], |
| 7704 | runtime_args, | 7703 | runtime_args, |
| 7705 | new_fn_info, | 7704 | mod.typeToFunc(func_ty).?, |
| 7706 | &runtime_i, | 7705 | &runtime_i, |
| 7707 | ) catch |err| switch (err) { | 7706 | ) catch |err| switch (err) { |
| 7708 | error.NeededSourceLocation => { | 7707 | error.NeededSourceLocation => { |
| ... | @@ -7713,7 +7712,7 @@ fn instantiateGenericCall( | ... | @@ -7713,7 +7712,7 @@ fn instantiateGenericCall( |
| 7713 | uncasted_args[total_i], | 7712 | uncasted_args[total_i], |
| 7714 | comptime_args[total_i], | 7713 | comptime_args[total_i], |
| 7715 | runtime_args, | 7714 | runtime_args, |
| 7716 | new_fn_info, | 7715 | mod.typeToFunc(func_ty).?, |
| 7717 | &runtime_i, | 7716 | &runtime_i, |
| 7718 | ); | 7717 | ); |
| 7719 | unreachable; | 7718 | unreachable; |
| ... | @@ -7723,12 +7722,12 @@ fn instantiateGenericCall( | ... | @@ -7723,12 +7722,12 @@ fn instantiateGenericCall( |
| 7723 | total_i += 1; | 7722 | total_i += 1; |
| 7724 | } | 7723 | } |
| 7725 | | 7724 | |
| 7726 | try sema.queueFullTypeResolution(new_fn_info.return_type.toType()); | 7725 | try sema.queueFullTypeResolution(mod.typeToFunc(func_ty).?.return_type.toType()); |
| 7727 | } | 7726 | } |
| 7728 | | 7727 | |
| 7729 | if (call_dbg_node) |some| try sema.zirDbgStmt(block, some); | 7728 | if (call_dbg_node) |some| try sema.zirDbgStmt(block, some); |
| 7730 | | 7729 | |
| 7731 | if (sema.owner_func != null and new_fn_info.return_type.toType().isError(mod)) { | 7730 | if (sema.owner_func != null and mod.typeToFunc(func_ty).?.return_type.toType().isError(mod)) { |
| 7732 | sema.owner_func.?.calls_or_awaits_errorable_fn = true; | 7731 | sema.owner_func.?.calls_or_awaits_errorable_fn = true; |
| 7733 | } | 7732 | } |
| 7734 | | 7733 | |
| ... | @@ -16346,10 +16345,9 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai | ... | @@ -16346,10 +16345,9 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 16346 | // Optional value is only null if anyerror | 16345 | // Optional value is only null if anyerror |
| 16347 | // Value can be zero-length slice otherwise | 16346 | // Value can be zero-length slice otherwise |
| 16348 | const error_field_vals = if (ty.isAnyError(mod)) null else blk: { | 16347 | const error_field_vals = if (ty.isAnyError(mod)) null else blk: { |
| 16349 | const names = ty.errorSetNames(mod); | 16348 | const vals = try sema.arena.alloc(InternPool.Index, ty.errorSetNames(mod).len); |
| 16350 | const vals = try sema.arena.alloc(InternPool.Index, names.len); | 16349 | for (vals, 0..) |*field_val, i| { |
| 16351 | for (vals, names) |*field_val, name_ip| { | 16350 | const name = ip.stringToSlice(ty.errorSetNames(mod)[i]); |
| 16352 | const name = ip.stringToSlice(name_ip); | | |
| 16353 | const name_val = v: { | 16351 | const name_val = v: { |
| 16354 | var anon_decl = try block.startAnonDecl(); | 16352 | var anon_decl = try block.startAnonDecl(); |
| 16355 | defer anon_decl.deinit(); | 16353 | defer anon_decl.deinit(); |