Sema: export function instead of the constant referencing it

Closes #13706
This commit is contained in:
Veikka Tuominen 2022-12-05 18:14:37 +02:00
parent 92f1a29c40
commit d078d08e4f

View File

@ -5405,6 +5405,13 @@ fn zirExport(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void
},
else => |e| return e,
};
{
try sema.mod.ensureDeclAnalyzed(decl_index);
const exported_decl = sema.mod.declPtr(decl_index);
if (exported_decl.val.castTag(.function)) |some| {
return sema.analyzeExport(block, src, options, some.data.owner_decl);
}
}
try sema.analyzeExport(block, src, options, decl_index);
}