Skip to content

Type considered as a runtime value #10334

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
ghost opened this issue Dec 14, 2021 · 1 comment
Closed

Type considered as a runtime value #10334

ghost opened this issue Dec 14, 2021 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@ghost
Copy link

ghost commented Dec 14, 2021

Zig Version

0.9.0-dev.1952+5d1aab72d

Steps to Reproduce

//bug.zig

pub fn main() void {
    const T = blk: {
        if (true) break :blk u32;
        break :blk u8;
    };
    comptime { _ = T; }
}

zig build-exe bug.zig

Expected Behavior

The program should compile with no errors.

Actual Behavior

./bug.zig:3:30: error: cannot store runtime value in type 'type'
        if (true) break :blk u32;
@ghost ghost added the bug Observed behavior contradicts documented or intended behavior label Dec 14, 2021
@andrewrk andrewrk added the stage1 The process of building from source via WebAssembly and the C backend. label Dec 14, 2021
@andrewrk andrewrk added this to the 0.11.0 milestone Dec 14, 2021
@Vexu
Copy link
Member

Vexu commented Jan 16, 2023

Duplicate of #3376

@Vexu Vexu marked this as a duplicate of #3376 Jan 16, 2023
@Vexu Vexu closed this as completed Jan 16, 2023
@andrewrk andrewrk modified the milestones: 0.12.0, 0.11.0 Jan 16, 2023
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

2 participants