zig/doc/langref/test_comptime_invalid_null_pointer_cast.zig

8 lines
143 B
Zig
Raw Normal View History

comptime {
const opt_ptr: ?*i32 = null;
const ptr: *i32 = @ptrCast(opt_ptr);
_ = ptr;
}
// test_error=null pointer casted to type