Skip to content
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

Error message cursor at wrong position for packed struct containing packed union #22088

Open
wooster0 opened this issue Nov 28, 2024 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@wooster0
Copy link
Contributor

Zig Version

0.14.0-dev.2273+73dcd1914

Steps to Reproduce and Observed Behavior

const X = packed struct {
    a: packed union {
        b: u8,
    },
};

test {
    const y: X = undefined;
    y.a = .{ .b = 0 };
}
x.zig:9:19: error: cannot assign to constant
    y.a = .{ .b = 0 };
                  ^

Expected Behavior

x.zig:9:19: error: cannot assign to constant
    y.a = .{ .b = 0 };
    ^
@wooster0 wooster0 added the bug Observed behavior contradicts documented or intended behavior label Nov 28, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant