zig/doc/langref/runtime_invalid_error_code.zig

12 lines
255 B
Zig

const std = @import("std");
pub fn main() void {
const err = error.AnError;
var number = @intFromError(err) + 500;
_ = &number;
const invalid_err = @errorFromInt(number);
std.debug.print("value: {}\n", .{invalid_err});
}
// exe=fail