Skip to content

EPA: Deal with header comments attached to first module decl

Alan Zimmerman requested to merge wip/az/T23984-module-sameline-comment into master

After parsing, fix up the header comments by looking for a where keyword and moving any comments in the first declaration that precede it into the header comments.

This only affects a specific scenario where

  • There are comments in the lines before the module header
  • There is a comment on the same line as the 'where', preceding it
  • There is a decl immediately following the line with the comment and 'where' token

Closes #23984

Note: there is no need to backport to GHC 9.8.1, as the fix is already in ghc-exactprint.

Merge request reports