aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2019-09-01 23:45:51 +0200
committerRobin Voetter <robin@voetter.nl>2019-09-01 23:45:51 +0200
commitd62f7c6b605a672f032aff8870496d2ae2366017 (patch)
tree659ae46ac0061fcafd3ec29de8682ec1f18e97cc /test/compile_errors.zig
parente7912dee9bd63b03415f441b4de9b3babc79c859 (diff)
parent8b1900e5df76a126404c6905b9e91136c738da55 (diff)
downloadzig-d62f7c6b605a672f032aff8870496d2ae2366017.tar.gz
zig-d62f7c6b605a672f032aff8870496d2ae2366017.zip
Merge remote-tracking branch 'upstream/master' into arm-support-improvement
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 91916e6f38..12f17ec790 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -3,6 +3,22 @@ const builtin = @import("builtin");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
+ "wrong type for result ptr to @asyncCall",
+ \\export fn entry() void {
+ \\ _ = async amain();
+ \\}
+ \\fn amain() i32 {
+ \\ var frame: @Frame(foo) = undefined;
+ \\ return await @asyncCall(&frame, false, foo);
+ \\}
+ \\fn foo() i32 {
+ \\ return 1234;
+ \\}
+ ,
+ "tmp.zig:6:37: error: expected type '*i32', found 'bool'",
+ );
+
+ cases.add(
"struct depends on itself via optional field",
\\const LhsExpr = struct {
\\ rhsExpr: ?AstObject,
@@ -1051,6 +1067,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\const Foo = struct {};
\\export fn a() void {
\\ const T = [*c]Foo;
+ \\ var t: T = undefined;
\\}
,
"tmp.zig:3:19: error: C pointers cannot point to non-C-ABI-compatible type 'Foo'",
@@ -2290,6 +2307,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
"error union operator with non error set LHS",
\\comptime {
\\ const z = i32!i32;
+ \\ var x: z = undefined;
\\}
,
"tmp.zig:2:15: error: expected error set type, found type 'i32'",