Skip to content

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

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

Closed
JesseRMeyer opened this issue Oct 14, 2019 · 2 comments
Closed

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

JesseRMeyer opened this issue Oct 14, 2019 · 2 comments
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@JesseRMeyer
Copy link

JesseRMeyer commented Oct 14, 2019

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.

@andrewrk andrewrk added this to the 0.6.0 milestone Oct 14, 2019
@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend. labels Oct 14, 2019
@andrewrk
Copy link
Member

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

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

test "" {
    _ = x;
}

@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Feb 18, 2020
@Vexu
Copy link
Member

Vexu commented Apr 8, 2020

Fixed in master.

./build/a.zig:275:33: error: container 'std.os' has no member called 'window'
usingnamespace @import("std").os.window;
                                ^

@Vexu Vexu closed this as completed Apr 8, 2020
@Vexu Vexu modified the milestones: 0.7.0, 0.6.0 Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Projects
None yet
Development

No branches or pull requests

3 participants