| ... | ... | @@ -56,3 +56,16 @@ test "coerce extern function types" { |
| 56 | 56 | |
| 57 | 57 | _ = @as(fn () callconv(.c) ?*u32, c_extern_function); |
| 58 | 58 | } |
| 59 | |
| 60 | fn a_function(func: fn () callconv(.c) void) void { |
| 61 | _ = func; |
| 62 | } |
| 63 | |
| 64 | test "pass extern function to function" { |
| 65 | a_function(struct { |
| 66 | extern fn an_extern_function() void; |
| 67 | }.an_extern_function); |
| 68 | a_function(@extern(*const fn () callconv(.c) void, .{ .name = "an_extern_function" }).*); |
| 69 | } |
| 70 | |
| 71 | export fn an_extern_function() void {} |