aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/address_of_number_literal.zig
blob: 3ec9655cf280caf342bc6e72ed76ae4291664442 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const x = 3;
const y = &x;
fn foo() *const i32 {
    return y;
}
export fn entry() usize {
    return @sizeOf(@TypeOf(&foo));
}

// error
//
// :4:12: error: expected type '*const i32', found '*const comptime_int'
// :4:12: note: pointer type child 'comptime_int' cannot cast into pointer type child 'i32'
// :3:10: note: function return type declared here