@@ -779,7 +779,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
779
779
});
780
780
781
781
cases .add ("exported async function" ,
782
- \\export async fn foo() void {}
782
+ \\export fn foo() callconv(.Async ) void {}
783
783
, &[_ ][]const u8 {
784
784
"tmp.zig:1:1: error: exported function cannot be async" ,
785
785
});
@@ -1258,11 +1258,11 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1258
1258
1259
1259
cases .add ("bad alignment in @asyncCall" ,
1260
1260
\\export fn entry() void {
1261
- \\ var ptr: async fn () void = func;
1261
+ \\ var ptr: fn () callconv(.Async ) void = func;
1262
1262
\\ var bytes: [64]u8 = undefined;
1263
1263
\\ _ = @asyncCall(&bytes, {}, ptr);
1264
1264
\\}
1265
- \\async fn func() void {}
1265
+ \\fn func() callconv(.Async ) void {}
1266
1266
, &[_ ][]const u8 {
1267
1267
"tmp.zig:4:21: error: expected type '[]align(16) u8', found '*[64]u8'" ,
1268
1268
});
@@ -1408,7 +1408,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1408
1408
\\export fn entry() void {
1409
1409
\\ _ = async amain();
1410
1410
\\}
1411
- \\async fn amain() void {
1411
+ \\fn amain() callconv(.Async ) void {
1412
1412
\\ other();
1413
1413
\\}
1414
1414
\\fn other() void {
@@ -1424,7 +1424,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1424
1424
\\export fn entry() void {
1425
1425
\\ _ = async amain();
1426
1426
\\}
1427
- \\async fn amain() void {
1427
+ \\fn amain() callconv(.Async ) void {
1428
1428
\\ var x: [@sizeOf(@Frame(amain))]u8 = undefined;
1429
1429
\\}
1430
1430
, &[_ ][]const u8 {
@@ -1451,7 +1451,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1451
1451
\\ var ptr = afunc;
1452
1452
\\ _ = ptr();
1453
1453
\\}
1454
- \\async fn afunc() void {}
1454
+ \\fn afunc() callconv(.Async ) void {}
1455
1455
, &[_ ][]const u8 {
1456
1456
"tmp.zig:6:12: error: function is not comptime-known; @asyncCall required" ,
1457
1457
});
@@ -1462,7 +1462,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1462
1462
\\ _ = async ptr();
1463
1463
\\}
1464
1464
\\
1465
- \\async fn afunc() void { }
1465
+ \\fn afunc() callconv(.Async ) void { }
1466
1466
, &[_ ][]const u8 {
1467
1467
"tmp.zig:3:15: error: function is not comptime-known; @asyncCall required" ,
1468
1468
});
@@ -3051,7 +3051,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3051
3051
\\export fn entry() void {
3052
3052
\\ _ = async foo();
3053
3053
\\}
3054
- \\async fn foo() void {
3054
+ \\fn foo() void {
3055
3055
\\ suspend {
3056
3056
\\ suspend {
3057
3057
\\ }
@@ -3099,7 +3099,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3099
3099
\\export fn entry() void {
3100
3100
\\ _ = async amain();
3101
3101
\\}
3102
- \\async fn amain() void {
3102
+ \\fn amain() callconv(.Async ) void {
3103
3103
\\ return error.ShouldBeCompileError;
3104
3104
\\}
3105
3105
, &[_ ][]const u8 {
@@ -3569,7 +3569,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3569
3569
});
3570
3570
3571
3571
cases .add ("attempt to use 0 bit type in extern fn" ,
3572
- \\extern fn foo(ptr: extern fn(*void) void) void;
3572
+ \\extern fn foo(ptr: fn(*void) callconv(.C ) void) void;
3573
3573
\\
3574
3574
\\export fn entry() void {
3575
3575
\\ foo(bar);
@@ -3580,7 +3580,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
3580
3580
\\ bar(&{});
3581
3581
\\}
3582
3582
, &[_ ][]const u8 {
3583
- "tmp.zig:1:30 : error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C'" ,
3583
+ "tmp.zig:1:23 : error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C'" ,
3584
3584
"tmp.zig:7:11: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'C'" ,
3585
3585
});
3586
3586
0 commit comments