@@ -802,7 +802,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
802
802
});
803
803
804
804
cases .add ("exported async function" ,
805
- \\export async fn foo() void {}
805
+ \\export fn foo() callconv(.Async ) void {}
806
806
, &[_ ][]const u8 {
807
807
"tmp.zig:1:1: error: exported function cannot be async" ,
808
808
});
@@ -1281,11 +1281,11 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1281
1281
1282
1282
cases .add ("bad alignment in @asyncCall" ,
1283
1283
\\export fn entry() void {
1284
- \\ var ptr: async fn () void = func;
1284
+ \\ var ptr: fn () callconv(.Async ) void = func;
1285
1285
\\ var bytes: [64]u8 = undefined;
1286
1286
\\ _ = @asyncCall(&bytes, {}, ptr);
1287
1287
\\}
1288
- \\async fn func() void {}
1288
+ \\fn func() callconv(.Async ) void {}
1289
1289
, &[_ ][]const u8 {
1290
1290
"tmp.zig:4:21: error: expected type '[]align(16) u8', found '*[64]u8'" ,
1291
1291
});
@@ -1431,7 +1431,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1431
1431
\\export fn entry() void {
1432
1432
\\ _ = async amain();
1433
1433
\\}
1434
- \\async fn amain() void {
1434
+ \\fn amain() callconv(.Async ) void {
1435
1435
\\ other();
1436
1436
\\}
1437
1437
\\fn other() void {
@@ -1447,7 +1447,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1447
1447
\\export fn entry() void {
1448
1448
\\ _ = async amain();
1449
1449
\\}
1450
- \\async fn amain() void {
1450
+ \\fn amain() callconv(.Async ) void {
1451
1451
\\ var x: [@sizeOf(@Frame(amain))]u8 = undefined;
1452
1452
\\}
1453
1453
, &[_ ][]const u8 {
@@ -1474,7 +1474,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1474
1474
\\ var ptr = afunc;
1475
1475
\\ _ = ptr();
1476
1476
\\}
1477
- \\async fn afunc() void {}
1477
+ \\fn afunc() callconv(.Async ) void {}
1478
1478
, &[_ ][]const u8 {
1479
1479
"tmp.zig:6:12: error: function is not comptime-known; @asyncCall required" ,
1480
1480
});
@@ -1485,7 +1485,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1485
1485
\\ _ = async ptr();
1486
1486
\\}
1487
1487
\\
1488
- \\async fn afunc() void { }
1488
+ \\fn afunc() callconv(.Async ) void { }
1489
1489
, &[_ ][]const u8 {
1490
1490
"tmp.zig:3:15: error: function is not comptime-known; @asyncCall required" ,
1491
1491
});
@@ -3074,7 +3074,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3074
3074
\\export fn entry() void {
3075
3075
\\ _ = async foo();
3076
3076
\\}
3077
- \\async fn foo() void {
3077
+ \\fn foo() void {
3078
3078
\\ suspend {
3079
3079
\\ suspend {
3080
3080
\\ }
@@ -3122,7 +3122,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3122
3122
\\export fn entry() void {
3123
3123
\\ _ = async amain();
3124
3124
\\}
3125
- \\async fn amain() void {
3125
+ \\fn amain() callconv(.Async ) void {
3126
3126
\\ return error.ShouldBeCompileError;
3127
3127
\\}
3128
3128
, &[_ ][]const u8 {
@@ -3592,7 +3592,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3592
3592
});
3593
3593
3594
3594
cases .add ("attempt to use 0 bit type in extern fn" ,
3595
- \\extern fn foo(ptr: extern fn(*void) void) void;
3595
+ \\extern fn foo(ptr: fn(*void) callconv(.C ) void) void;
3596
3596
\\
3597
3597
\\export fn entry() void {
3598
3598
\\ foo(bar);
@@ -3603,7 +3603,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3603
3603
\\ bar(&{});
3604
3604
\\}
3605
3605
, &[_ ][]const u8 {
3606
- "tmp.zig:1:30 : error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C'" ,
3606
+ "tmp.zig:1:23 : error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C'" ,
3607
3607
"tmp.zig:7:11: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C'" ,
3608
3608
});
3609
3609
0 commit comments