Skip to content

Missing result locations for builtin types #16211

Closed
@vesim987

Description

@vesim987

Zig Version

0.11.0-dev.3826+7a197f124

Steps to Reproduce and Observed Behavior

While porting microzig to latest zig version I have found couple of missing result locations for builtins.

const Foo = struct {
    bar: u32,
};

const MyStruct = struct {
    foo: *Foo,
};

export fn issue_1() void {
    _ = MyStruct{
        .foo = &.{
            .bar = @intCast(20),
        },
    };
}

fn do_something(_: *Foo) void {}

export fn issue_2() void {
    do_something(&.{
        .bar = @intCast(20),
    });
}


export fn isse_3 () void {
  _ = [1]u16{
      @intCast(20),
  };
}

It also applies to other builtins.

Expected Behavior

Every example to compile.

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

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions