Skip to content

9.10.1-alpha1 regression: certain comments missing from AST

Summary

In GHC 9.10.1-alpha1, certain comments do no longer occur in the AST compared to previous GHCs.

I noticed this while upgrading the Ormolu code formatter to GHC 9.10.1-alpha1 (for early integration) as it relies on this.

Steps to reproduce

Compile eg this code with -ddump-parsed-ast -dkeep-comments

instance
  ( Read a, -- Weird
    Read b
  ) =>
  Read (a, b)

with GHC 9.10.1-alpha1, and note that the substring Weird does not occur in the output, in contrast to previous GHCs.

Expected behavior

The pre-9.10.1-alpha1 behavior should be restored.

Additional information

Bisecting points to !11716 (closed) introducing this. cc @alanz

Environment

  • GHC version used: 9.10.1-alpha1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information