Zig: Compiler Bug: Typo in import statement causes compiler to crash.

Created on 14 Oct 2019  路  2Comments  路  Source: ziglang/zig

usingnamespace @import("std").os.window;

instead of

usingnamespace @import("std").os.windows;

causes : when analyzing C:\dev\src\test.zig:5:30: assertion failed. This is a bug in the Zig compiler. Unable to dump stack trace: debug info stripped

While I do expect the compilation to fail, I do not expect the compiler to crash.

As an aside, are there plans or an active attempt to output the conditions under which assertions fail to provide clearer feedback? Providing the condition which failed would go a long way in clarifying the exact error.

bug stage1

All 2 comments

Here's a full test case that triggers the crash:

usingnamespace @import("std").os.window;

test "" {
    _ = x;
}

Fixed in master.

./build/a.zig:275:33: error: container 'std.os' has no member called 'window'
usingnamespace @import("std").os.window;
                                ^
Was this page helpful?
0 / 5 - 0 ratings