aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/extern_function_with_comptime_parameter.zig
blob: 07fe34ad7f3a82c27351e04c3ffa874028c8b458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
extern fn foo(comptime x: i32, y: i32) i32;
fn f() i32 {
    return foo(1, 2);
}
pub extern fn entry1(b: u32, comptime a: [2]u8, c: i32) void;
pub extern fn entry2(b: u32, noalias a: anytype, i43) void;
comptime {
    _ = &f;
}
comptime {
    _ = &entry1;
}
comptime {
    _ = &entry2;
}

// error
// backend=stage2
// target=native
//
// :1:15: error: comptime parameters not allowed in function with calling convention 'C'
// :5:30: error: comptime parameters not allowed in function with calling convention 'C'
// :6:30: error: generic parameters not allowed in function with calling convention 'C'