aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/compile_time_null_ptr_cast.zig
blob: d3750c865407633c2b40c7fb04d8ee1b9113b836 (plain)
1
2
3
4
5
6
7
8
9
10
11
comptime {
    var opt_ptr: ?*i32 = null;
    const ptr = @ptrCast(*i32, opt_ptr);
    _ = ptr;
}

// error
// backend=llvm
// target=native
//
// :3:32: error: null pointer casted to type *i32