New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertion tripped when constant inside comptime function has compile error #625

Closed
andrewrk opened this Issue Nov 25, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@andrewrk
Member

andrewrk commented Nov 25, 2017

const ContextAllocator = MemoryPool(usize);

pub fn MemoryPool(comptime T: type) -> type {
    const free_list_t = @compileError("aoeu");

    struct {
        free_list: free_list_t,
    }
}

test "foo" {
    var allocator: ContextAllocator = undefined;
}
[nix-shell:~/dev/zig/build]$ ./zig test test.zig 
zig: /home/andy/dev/zig/src/ir.cpp:10337: IrInstruction* ir_get_var_ptr(IrAnalyze*, IrInstruction*, VariableTableEntry*, bool, bool): Assertion `var->value->type' failed.
Aborted

@andrewrk andrewrk added the bug label Nov 25, 2017

@andrewrk andrewrk added this to the 0.2.0 milestone Nov 25, 2017

@andrewrk andrewrk closed this in a2afcae Nov 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment