diff options
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 9cecb859fa..ab539dd94a 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,19 @@ const tests = @import("tests.zig"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.add( + "field access of unknown length pointer", + \\const Foo = extern struct { + \\ a: i32, + \\}; + \\ + \\export fn entry(foo: [*]Foo) void { + \\ foo.a += 1; + \\} + , + ".tmp_source.zig:6:8: error: type '[*]Foo' does not support field access", + ); + + cases.add( "unknown length pointer to opaque", \\export const T = [*]@OpaqueType(); , |
