Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unparseable output with type-level tuples and NoListTuplePuns #1146

Open
amesgen opened this issue Nov 26, 2024 · 0 comments · May be fixed by #1140
Open

Unparseable output with type-level tuples and NoListTuplePuns #1146

amesgen opened this issue Nov 26, 2024 · 0 comments · May be fixed by #1140
Labels
bug Something isn't working

Comments

@amesgen
Copy link
Member

amesgen commented Nov 26, 2024

Formatting

{-# Language NoListTuplePuns #-}

type X = (Int, String)

fails with

<input>:3:10-23
  Parsing of formatted code failed:
  [GHC-52943] Disambiguating data constructors of tuples and lists is disabled.
Remove the quote to use the data constructor.

as the output with --unsafe is

{-# LANGUAGE NoListTuplePuns #-}

type X = '(Int, String)

which is invalid when ListTuplePuns is disabled.

Environment

  • Version of the code: Current master (bb9e7b1)

Additional context
While we could do a hacky fix already now, #1140 allows us to fix this in a nicer way because HsExplicitTuple tracks the PromotionFlag directly there; and this issue doesn't seem very major as only very few people are currently using NoListTuplePuns.

@amesgen amesgen added the bug Something isn't working label Nov 26, 2024
amesgen added a commit that referenced this issue Nov 26, 2024
This can only occur with `NoListTuplePuns`.

Closes #1146
@amesgen amesgen linked a pull request Nov 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant