From d92cca9324e71705af9134de70e1e995ba8aa57a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 23 Jul 2023 18:39:58 -0700 Subject: [PATCH] InternPool: add func_coerced handling to getFuncInstanceIes Oops, there was a missing call to `unwrapCoercedFunc`. --- src/InternPool.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/InternPool.zig b/src/InternPool.zig index 8a160d9e39bdfd1ad15f8591f0d7578a78809b14..0c01c9988c47ca44e3b29cf381a06aea4342d98f 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -4819,6 +4819,8 @@ pub fn getFuncInstanceIes( assert(arg.bare_return_type != .none); for (arg.param_types) |param_type| assert(param_type != .none); + const generic_owner = unwrapCoercedFunc(ip, arg.generic_owner); + // The strategy here is to add the function decl unconditionally, then to // ask if it already exists, and if so, revert the lengths of the mutated // arrays. This is similar to what `getOrPutTrailingString` does. @@ -4854,7 +4856,7 @@ pub fn getFuncInstanceIes( .owner_decl = undefined, .ty = func_ty, .branch_quota = 0, - .generic_owner = arg.generic_owner, + .generic_owner = generic_owner, }); ip.extra.appendAssumeCapacity(@intFromEnum(Index.none)); // resolved error set ip.extra.appendSliceAssumeCapacity(@ptrCast(arg.comptime_args)); @@ -4927,7 +4929,7 @@ pub fn getFuncInstanceIes( return finishFuncInstance( ip, gpa, - arg.generic_owner, + generic_owner, func_index, func_extra_index, arg.generation, -- 2.54.0