export fn fn_error_set(decl_index: Decl.Index) Ast.Node.OptionalIndex
export fn fn_error_set(decl_index: Decl.Index) Ast.Node.OptionalIndex { const decl = decl_index.get(); const ast = decl.file.get_ast(); var buf: [1]Ast.Node.Index = undefined; const full = ast.fullFnProto(&buf, decl.ast_node).?; const return_type = full.ast.return_type.unwrap().?; return switch (ast.nodeTag(return_type)) { .error_set_decl => return_type.toOptional(), .error_union => ast.nodeData(return_type).node_and_node[0].toOptional(), else => .none, }; }