Files
zig/test/cases/compile_errors/address_of_number_literal.zig
2022-07-11 17:55:19 +03:00

13 lines
384 B
Zig

const x = 3;
const y = &x;
fn foo() *const i32 { return y; }
export fn entry() usize { return @sizeOf(@TypeOf(&foo)); }
// error
// backend=stage2
// target=native
//
// :3:30: error: expected type '*const i32', found '*const comptime_int'
// :3:30: note: pointer type child 'comptime_int' cannot cast into pointer type child 'i32'
// :3:10: note: function return type declared here