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 }}
Repository navigation
Formatter moves an attribute in front of ~a as x: int onto x #9101
Found by a bug hunt over the 16 commits from eb087382 to cd641cbc.
letg= (@attr ~aasx: int) =>x
bsc -format prints:
letg= (~aas @attrx: int) =>x
The attribute is on the Ppat_constraint pattern before formatting and on the inner Ppat_var "x" after, so formatting changes the AST. The same happens at b123b7c3.
Since #9055 a doc comment is accepted in the same position, and it is printed in the same place:
leth= (/** a */ ~aasx: int=3) =>x
prints as ~a as /** a */ with x: int=3 on the next line.
Cause
The ~b as c arm of print_exp_fun_parameter (res_printer.ml#L5650-L5658) prints ~lbl as, then the whole pattern including its attributes.
Activity
Keep attributes in front of a labeled parameter alias when formatting (…