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
But aside from that issue, it seems like Ormolu doesn't format a fully documented infix constructor correctly anyway. Here's an example:
dataFoo=Int--^ Docs for left arg:*:--^ Docs for constructorInt--^ Docs for right arg
This fails to output valid Haskell:
<input>@@-1,4+1,8@@dataFoo-=Int--^ Docs for left arg-:*:--^ Docs for constructor-Int--^ Docs for right arg+=--| Docs for constructor++--| Docs for left arg+Int+:*:--| Docs for right arg+Int+ASTof input andASTof formatted code differ.
at <input>:2:5-7
at <input>:2:9-30Please, consider reporting the bug.To format anyway, use --unsafe.
Describe the bug
This snippet can't be formatted without
--unsafe
(minimized from Agda):With
--unsafe
, it is formatted toIn the first case, the Haddock comment is attached to the constructor
:#
, but in the second case, it is attached to the first argument of:#
.Expected behavior
It could be formatted like this to preserve the AST:
But this is not really nice from a sylistic perspective (we should not have to break apart an existing single line constructor variant).
Environment
Ormolu 0.2.0.0
Additional context
This changed in GHC 9.0; previously, both snippets had the same AST.
The text was updated successfully, but these errors were encountered: