Skip to content

stage2 should analyze struct default values lazily #11307

@Vexu

Description

@Vexu
test {
    const S = struct {
        __pad: [32]u8 = @compileError("do not initiate directly"),
    };
    var s: S = undefined;
    _ = s;
    var s2 = S{ .__pad = undefined };
    _ = s2;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions