mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
Declare generic fn dependency earlier to keep invariant
This commit is contained in:
parent
f7c11acb7f
commit
d1a4bdb1f3
10
src/Sema.zig
10
src/Sema.zig
@ -3279,6 +3279,11 @@ fn analyzeCall(
|
||||
|
||||
namespace.anon_decls.putAssumeCapacityNoClobber(new_decl, {});
|
||||
|
||||
// The generic function Decl is guaranteed to be the first dependency
|
||||
// of each of its instantiations.
|
||||
assert(new_decl.dependencies.keys().len == 0);
|
||||
try mod.declareDeclDependency(new_decl, module_fn.owner_decl);
|
||||
|
||||
var new_decl_arena = std.heap.ArenaAllocator.init(sema.gpa);
|
||||
errdefer new_decl_arena.deinit();
|
||||
|
||||
@ -3411,11 +3416,6 @@ fn analyzeCall(
|
||||
});
|
||||
assert(!new_decl.ty.fnInfo().is_generic);
|
||||
|
||||
// The generic function Decl is guaranteed to be the first dependency
|
||||
// of each of its instantiations.
|
||||
assert(new_decl.dependencies.keys().len == 0);
|
||||
try mod.declareDeclDependency(new_decl, module_fn.owner_decl);
|
||||
|
||||
// Queue up a `codegen_func` work item for the new Fn. The `comptime_args` field
|
||||
// will be populated, ensuring it will have `analyzeBody` called with the ZIR
|
||||
// parameters mapped appropriately.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user