diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-10-16 12:26:06 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-10-16 12:26:06 -0700 |
| commit | 4d6d6977b05571e6d164dbf5f26c7a48ee3541a3 (patch) | |
| tree | beb25554dc6e6f9f238ee84d0096f89a557f4ea5 /src/Sema.zig | |
| parent | 82ec56e47e004176cc380cc69764602c4a8d0768 (diff) | |
| download | zig-4d6d6977b05571e6d164dbf5f26c7a48ee3541a3.tar.gz zig-4d6d6977b05571e6d164dbf5f26c7a48ee3541a3.zip | |
stage2: fixes to extern variables
* Relax compile error for "unable to export type foo" to allow
integers, structs, arrays, and floats. This will need to be further
improved to do the same checks as we do for C ABI struct field types.
* LLVM backend: fix extern variables
* LLVM backend: implement AIR instruction `wrap_err_union_payload`
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 4c3f20f28b..e1874c6e8b 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -3020,8 +3020,9 @@ pub fn analyzeExport( const mod = sema.mod; try mod.ensureDeclAnalyzed(exported_decl); + // TODO run the same checks as we do for C ABI struct fields switch (exported_decl.ty.zigTypeTag()) { - .Fn => {}, + .Fn, .Int, .Struct, .Array, .Float => {}, else => return sema.fail(block, src, "unable to export type '{}'", .{exported_decl.ty}), } |
