Skip to content

Fails to parse export list with single element and Haddock comment when import/export style is leading #341

@tfausak

Description

@tfausak

Is your bug specific to Fourmolu?

  • Yes, I've verified that Ormolu does not have this bug

Did you try it on the web app?

Describe the bug
Provide steps to reproduce the bug, and what the expected behavior should be.

Trying to format this input with import-export-style: leading fails:

module A ( -- | b
c ) where

The error says:

A.hs:1:1
  The GHC parser (in Haddock mode) failed:
  {ErrorWithoutFlag
   parse error on input `c'}

Adding another identifier to the export list fixes the problem. So does removing the Haddock comment. A normal comment isn't sufficient to trigger the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions