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

zig fmt: extra whitespace in struct literals when using a multi string literal #13937

Closed
perillo opened this issue Dec 14, 2022 · 1 comment · Fixed by #13945
Closed

zig fmt: extra whitespace in struct literals when using a multi string literal #13937

perillo opened this issue Dec 14, 2022 · 1 comment · Fixed by #13945
Labels
bug Observed behavior contradicts documented or intended behavior zig fmt
Milestone

Comments

@perillo
Copy link
Contributor

perillo commented Dec 14, 2022

Zig Version

0.11.0-dev.753+331861161

Steps to Reproduce and Observed Behavior

const S = struct {
    text: []const u8,
    comment: []const u8,
};

test {
    const s = .{
        .text = 
        \\hello
        \\world
        ,
        .comment = "test",
    };

    _ = s;
}

Expected Behavior

No extra whitespace after .text =.

@perillo perillo added the bug Observed behavior contradicts documented or intended behavior label Dec 14, 2022
@perillo
Copy link
Contributor Author

perillo commented Dec 14, 2022

I found this issue in the file src/codegen/llvm.zig.
These are the affected lines:

src/codegen/llvm.zig 9862                 .template =<SP>
src/codegen/llvm.zig 9870                 .template =<SP>
src/codegen/llvm.zig 9878                 .template =<SP>

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 zig fmt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants