zig/doc/langref/runtime_index_out_of_bounds.zig

11 lines
122 B
Zig
Raw Normal View History

pub fn main() void {
const x = foo("hello");
_ = x;
}
fn foo(x: []const u8) u8 {
return x[5];
}
// exe=fail