diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-03-09 18:36:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-09 18:36:01 -0400 |
| commit | 638d5c3aca7ce1e4fd10060079caa0acb66144c0 (patch) | |
| tree | 7001b05a51eea62061ad9dfcba8b99d904ea1be5 /test/compile_errors.zig | |
| parent | 52c01840ce36f6ed6528fc62c6f3c1426bdce914 (diff) | |
| parent | 3fd2cd43678d52ca2f737d991edaddfd8b73c2a4 (diff) | |
| download | zig-638d5c3aca7ce1e4fd10060079caa0acb66144c0.tar.gz zig-638d5c3aca7ce1e4fd10060079caa0acb66144c0.zip | |
Merge pull request #4700 from Vexu/noasync
Implement new noasync syntax
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 717793baaa..4434920224 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,21 @@ const tests = @import("tests.zig"); const std = @import("std"); pub fn addCases(cases: *tests.CompileErrorContext) void { + cases.addTest("combination of noasync and async", + \\export fn entry() void { + \\ noasync { + \\ const bar = async foo(); + \\ suspend; + \\ resume bar; + \\ } + \\} + \\fn foo() void {} + , &[_][]const u8{ + "tmp.zig:3:21: error: async call in noasync scope", + "tmp.zig:4:9: error: suspend in noasync scope", + "tmp.zig:5:9: error: resume in noasync scope", + }); + cases.addTest("@TypeOf with no arguments", \\export fn entry() void { \\ _ = @TypeOf(); |
