-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as duplicate of#18088
Copy link
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.15.1
Steps to Reproduce
zig fmt --stdin <<EOF
fn f(
/// comment
x: u32,
y: u32
) void {}
EOFObserved Behavior
fn f(/// comment
x: u32, y: u32) void {}Expected Behavior
fn f(
/// comment
x: u32,
y: u32,
) void {}Further thoughts
-
This means
zig fmtis not idempotent because the following errors out ("same line documentation comment"):zig fmt --stdin <<EOF | zig fmt --stdin fn f( /// comment x: u32, y: u32 ) void {} EOF
-
It works with a trailing comma after the last parameter:
zig fmt --stdin <<EOF fn f( /// comment x: u32, y: u32, ) void {} EOF
-
It works for regular comments even without a trailing comma after the last parameter:
zig fmt --stdin <<EOF fn f( // comment x: u32, y: u32 ) void {} EOF
I found some issue about similar problems that are supposedly fixed. Maybe this got fixed in the past for // but not for /// for some reason?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior