Last active
September 9, 2018 23:59
-
-
Save cgag/7a293c6a7c4bd27cef7dcfe3538b7367 to your computer and use it in GitHub Desktop.
zig compiler assertion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const warn = std.debug.warn; | |
const fmt = std.fmt; | |
const mem = std.mem; | |
var alloc = &std.heap.DirectAllocator.init().allocator; | |
pub const Expr = union(enum) { | |
Literal: Literal, | |
}; | |
pub const Literal = union(enum) { | |
Number: f64, | |
Bool: bool, | |
}; | |
pub fn main() !void { | |
const s = try fmt.allocPrint(alloc, "{}", Expr{.Literal=Literal{.Bool=true}}); | |
warn("{}\n",s); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ryzen crafting-interpreters-zig/bugs [master●] » zig build-exe ./main.zig | |
zig: /home/cgag/bin/zig/src/codegen.cpp:4721: LLVMOpaqueValue* ir_render_union_tag(CodeGen*, IrExecutable*, IrInstructionUnionTag*): Assertion `union_type->data.unionation.gen_tag_index != SIZE_MAX' failed. | |
[1] 29563 abort (core dumped) zig run ./main.zig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment