Skip to content

AST of input and AST of formatted code differ on certain empty comments #1159

@nikita-volkov

Description

@nikita-volkov

Formatting the following code:

data A = A
  {
    -- |
    -- 
    a :: Int
  }

Results in the following error:

@@ -14,8 +14,6 @@
  data A = A
-   {
-     -- |
-     -- 
+   { -- |
      a :: Int
    }

  AST of input and AST of formatted code differ.
    at ***
  Please, consider reporting the bug.
  To format anyway, use --unsafe.

Environment

  • macOS 14.1.2
  • ormolu 0.7.7.0 using ghc-lib-parser 9.10.1.20240511

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcommentsIssues related to comment placement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions