diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-05 18:03:21 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-06-05 18:03:21 -0400 |
| commit | 652f4bdf6242462182005f4c7149f13beaaa3259 (patch) | |
| tree | e8b131095700c37604ebad9934f836e51538aabe /test/compile_errors.zig | |
| parent | 7a0948253636080e5abe59b938761ee7348a7025 (diff) | |
| download | zig-652f4bdf6242462182005f4c7149f13beaaa3259.tar.gz zig-652f4bdf6242462182005f4c7149f13beaaa3259.zip | |
disallow unknown-length pointer to opaque
This also means that translate-c has to detect when a pointer to
opaque is happening, and use `*` instead of `[*]`.
See #1059
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 4bd6e9bc24..9cecb859fa 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,13 @@ const tests = @import("tests.zig"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.add( + "unknown length pointer to opaque", + \\export const T = [*]@OpaqueType(); + , + ".tmp_source.zig:1:18: error: unknown-length pointer to opaque", + ); + + cases.add( "error when evaluating return type", \\const Foo = struct { \\ map: i32(i32), |
