aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorVexu <git@vexu.eu>2020-03-09 18:38:54 +0200
committerVexu <git@vexu.eu>2020-03-09 18:43:09 +0200
commit3fd2cd43678d52ca2f737d991edaddfd8b73c2a4 (patch)
tree1a69d7283d69664631b6d07a87257355bb71e2eb /test/compile_errors.zig
parent03c1431f9c0b651f3f1853f11112edc07555883d (diff)
downloadzig-3fd2cd43678d52ca2f737d991edaddfd8b73c2a4.tar.gz
zig-3fd2cd43678d52ca2f737d991edaddfd8b73c2a4.zip
add LemonBoy's test
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 7021f81554..4434920224 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -4,11 +4,17 @@ const std = @import("std");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.addTest("combination of noasync and async",
\\export fn entry() void {
- \\ noasync async foo();
+ \\ noasync {
+ \\ const bar = async foo();
+ \\ suspend;
+ \\ resume bar;
+ \\ }
\\}
\\fn foo() void {}
, &[_][]const u8{
- "tmp.zig:2:13: error: async call in noasync scope",
+ "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",