diff options
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index b3e0344d77..868ce578eb 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -1542,6 +1542,21 @@ pub const Fn = struct { // const zir = func.owner_decl.getFileScope().zir; return func.param_names[index]; } + + pub fn hasInferredErrorSet(func: Fn) bool { + const zir = func.owner_decl.getFileScope().zir; + const zir_tags = zir.instructions.items(.tag); + switch (zir_tags[func.zir_body_inst]) { + .func => return false, + .func_inferred => return true, + .extended => { + const extended = zir.instructions.items(.data)[func.zir_body_inst].extended; + const small = @bitCast(Zir.Inst.ExtendedFunc.Small, extended.small); + return small.is_inferred_error; + }, + else => unreachable, + } + } }; pub const Var = struct { |
