aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/extern_function_pointer_mismatch.zig
blob: 36a548ceb9cedb4ba000173bdd47a8cca0edbd37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const fns = [_](fn (i32) i32){ a, b, c };
pub fn a(x: i32) i32 {
    return x + 0;
}
pub fn b(x: i32) i32 {
    return x + 1;
}
export fn c(x: i32) i32 {
    return x + 2;
}

export fn entry() usize {
    return @sizeOf(@TypeOf(fns));
}

// error
// backend=stage2
// target=native
//
// :1:38: error: expected type 'fn (i32) i32', found 'fn (i32) callconv(.C) i32'
// :1:38: note: calling convention 'C' cannot cast into calling convention 'Unspecified'