IntersectMBO / IntersectMBO/plutus

`asData` should generate INLINEABLE pragmas

Open
#6,750 0 comments 1 reaction 0 assignees View on GitHub
bug Internal Plinth status: triaged tech debt
Dominant language
Haskell
Stars
1.6k
Forks
508
Avg merge
3d 10h
Merged PRs (30d)
22

Description

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: https://github.com/IntersectMBO/plutus/blob/e9b258319b09c2fa657b56841db6ab1cb9db4c6d/plutus-tx/src/PlutusTx/AsData.hs#L146.

I've tried to do this but for some reason GHC is fine when defining it manually in Haskell with `` but the constructor names we have access to in TH are of the form `_`. 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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.