Skip to content
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

Function taking TypeInfo and returning type crashed compiler #1600

Hejsil opened this Issue Sep 28, 2018 · 0 comments


None yet
2 participants
Copy link

Hejsil commented Sep 28, 2018

const builtin = @import("builtin");
const TypeInfo = builtin.TypeInfo;

pub fn a(comptime info: TypeInfo) type {
    return void;

test "a" {
    // zig/src/analyze.cpp:4915: bool can_mutate_comptime_var_state(ConstExprValue*): Assertion `value != nullptr' failed.
    _ = a(@typeInfo(type));

@andrewrk andrewrk added this to the 0.4.0 milestone Sep 29, 2018

@andrewrk andrewrk added the bug label Sep 29, 2018

Hejsil added a commit that referenced this issue Mar 8, 2019

@Hejsil Hejsil referenced this issue Mar 8, 2019


Fixed #1600 #2036

@andrewrk andrewrk closed this in 8eedec4 Mar 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.