Sema: correctly reset inst_map for analyzeInlineCallArg

Closes #12622
This commit is contained in:
Veikka Tuominen 2022-08-24 21:12:13 +03:00
parent f49dff64c6
commit 69a3c4e279
2 changed files with 15 additions and 2 deletions

View File

@ -5941,10 +5941,9 @@ fn analyzeCall(
undefined,
) catch |err| switch (err) {
error.NeededSourceLocation => {
sema.inst_map.clearRetainingCapacity();
_ = sema.inst_map.remove(inst);
const decl = sema.mod.declPtr(block.src_decl);
child_block.src_decl = block.src_decl;
arg_i = 0;
try sema.analyzeInlineCallArg(
block,
&child_block,

View File

@ -0,0 +1,14 @@
fn getSize() usize {
return 2;
}
pub fn expectEqual(expected: anytype, _: @TypeOf(expected)) !void {}
pub export fn entry() void {
try expectEqual(2, getSize());
}
// error
// backend=stage2
// target=native
//
// :6:31: error: unable to resolve comptime value
// :6:31: note: argument to parameter with comptime only type must be comptime known