Skip to content

preserve CTYPE pragmas in data declarations#725

Merged
mrkkrp merged 1 commit intomasterfrom
amesgen/issue-689
Aug 7, 2021
Merged

preserve CTYPE pragmas in data declarations#725
mrkkrp merged 1 commit intomasterfrom
amesgen/issue-689

Conversation

@amesgen
Copy link
Copy Markdown
Contributor

@amesgen amesgen commented Jul 26, 2021

Closes #689

This targets the ghc-9.0 branch right now, which will have to change as soon as #722 has been merged.


The dd_cType field of HsDataDefn had been ignored previously, which means that CTYPE pragmas were simply dropped on formatting.

As an aside: The dd_ctxt is also ignored, but the corresponding extension (DatatypeContexts) is deprecated, so I don't know if it is even worth to respect it.

@amesgen amesgen force-pushed the amesgen/issue-689 branch from 077bf51 to 79d9c24 Compare July 26, 2021 19:25
@amesgen
Copy link
Copy Markdown
Contributor Author

amesgen commented Jul 27, 2021

Maybe we could use safe-wild-cards in selected places where we want to ensure to actually use all available fields.

@mrkkrp
Copy link
Copy Markdown
Member

mrkkrp commented Aug 7, 2021

safe-wild-cards looks interesting, but for the sake of simplicity let's try to rely on existing testing methods. There might be fields that are ignored on purpose / are irrelevant yet they come bundled together with important fields like the one from this PR. I'm afraid it's more trouble than it's worth.

Base automatically changed from ghc-9.0 to master August 7, 2021 12:28
@mrkkrp mrkkrp force-pushed the amesgen/issue-689 branch from 79d9c24 to acf2290 Compare August 7, 2021 12:45
@mrkkrp mrkkrp merged commit 6344ffd into master Aug 7, 2021
@mrkkrp mrkkrp deleted the amesgen/issue-689 branch August 7, 2021 13:01
@amesgen amesgen mentioned this pull request Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AST differs when using CAPI CTYPE pragma

2 participants