Files
zig/test/cases/compile_errors/@import_zon_void.zig
Mason Remaley 13c6eb0d71 compiler,std: implement ZON support
This commit allows using ZON (Zig Object Notation) in a few ways.

* `@import` can be used to load ZON at comptime and convert it to a
  normal Zig value. In this case, `@import` must have a result type.
* `std.zon.parse` can be used to parse ZON at runtime, akin to the
  parsing logic in `std.json`.
* `std.zon.stringify` can be used to convert arbitrary data structures
  to ZON at runtime, again akin to `std.json`.
2025-02-03 09:14:37 +00:00

11 lines
279 B
Zig

export fn entry() void {
const f: union { foo: void } = @import("zon/void.zon");
_ = f;
}
// error
// imports=zon/void.zon
//
// void.zon:1:11: error: void literals are not available in ZON
// void.zon:1:11: note: void union payloads can be represented by enum literals