You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
I think the following output makes more sense, because it matches the implicit precedence of the merge operator.
footest{a=1;}//{b=2;c=3;}
When parentheses are added according to precedence, nixpkgs-fmt gives a result similar to the expected output above.
(footest{a=1;})//{b=2;c=3;}
Hence, I think the current output is confusing readers into the wrong precedence for //, and may trick them into parsing the expression incorrectly.
Now, I understand this issue is a bit tricky. In particular, when parentheses are added to perform the merge first (force higher precedence than default), nixpkgs-fmt gives a result quite similar to the one above. So parenthesizing the expression about anywhere changes the output. And I do not have a general rule to apply here yet, just this snippet.
footest({a=1;}//{b=2;c=3;})
PS: The online formatter with "submit code sample" is so nice to use !
The text was updated successfully, but these errors were encountered:
Input
Output
Desired output
I think the following output makes more sense, because it matches the implicit precedence of the merge operator.
When parentheses are added according to precedence, nixpkgs-fmt gives a result similar to the expected output above.
Hence, I think the current output is confusing readers into the wrong precedence for
//
, and may trick them into parsing the expression incorrectly.Now, I understand this issue is a bit tricky. In particular, when parentheses are added to perform the merge first (force higher precedence than default), nixpkgs-fmt gives a result quite similar to the one above. So parenthesizing the expression about anywhere changes the output. And I do not have a general rule to apply here yet, just this snippet.
PS: The online formatter with "submit code sample" is so nice to use !
The text was updated successfully, but these errors were encountered: