diff options
| author | John Schmidt <john.schmidt.h@gmail.com> | 2024-02-18 01:06:13 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-02-26 16:50:00 -0800 |
| commit | 8bd94759bf48c3247d4de14806ff2f510cb36591 (patch) | |
| tree | 4f761c514223e41130806361ebec476c174f4095 /src | |
| parent | 1b79a42da096fcdeac22b56f17f82b0c7ec22a9b (diff) | |
| download | zig-8bd94759bf48c3247d4de14806ff2f510cb36591.tar.gz zig-8bd94759bf48c3247d4de14806ff2f510cb36591.zip | |
Sema: evaluate generic instantiations in fn decls capture scope
The generic call `S.foo()` was evaluated with the
capture scope of the owner decl (i.e the `test` block), when it should
use the capture scope of the function declaration.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Sema.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 741c4e2fba..e0a8d1fe00 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -7951,7 +7951,7 @@ fn instantiateGenericCall( .sema = &child_sema, .src_decl = generic_owner_func.owner_decl, .namespace = namespace_index, - .wip_capture_scope = try mod.createCaptureScope(sema.owner_decl.src_scope), + .wip_capture_scope = try mod.createCaptureScope(fn_owner_decl.src_scope), .instructions = .{}, .inlining = null, .is_comptime = true, |
