Skip to content

Instantly share code, notes, and snippets.

Last active September 9, 2018 23:59
What would you like to do?
zig compiler assertion
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}});
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