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

asData should generate INLINEABLE pragmas #6750

Open
ana-pantilie opened this issue Dec 13, 2024 · 0 comments
Open

asData should generate INLINEABLE pragmas #6750

ana-pantilie opened this issue Dec 13, 2024 · 0 comments
Labels
bug status: needs triage GH issues that requires triage

Comments

@ana-pantilie
Copy link
Contributor

ana-pantilie commented Dec 13, 2024

The idea is to avoid having to add pragmas by hand in the case of asData. Sometimes GHC renames the TH generated pattern synonyms or the functions from the TH generated pattern synonym records and we don't want that. This can be done in this code:

let compl = TH.PragmaD (TH.CompleteP (fmap TH.constructorName cons) Nothing)
.

I've tried to do this but for some reason GHC is fine when defining it manually in Haskell with <PatternName> but the constructor names we have access to in TH are of the form <PatternName>_<number>. Example error:

src/PlutusLedgerApi/V3/Data/Contexts.hs:515:1: error: [GHC-55017]
    Illegal variable name: 'TxInfo'
    When splicing a TH declaration: {-# INLINABLE TxInfo_0 #-}
    |
515 | PlutusTx.asData
@github-actions github-actions bot added the status: needs triage GH issues that requires triage label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: needs triage GH issues that requires triage
Projects
None yet
Development

No branches or pull requests

1 participant