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

PlutusData typeclass implementation should be unconditionally printed during TyDef #148

Open
bladyjoker opened this issue Nov 17, 2023 · 0 comments
Labels
bug Something isn't working codegen plutarch All things Plutarch

Comments

@bladyjoker
Copy link
Contributor

bladyjoker commented Nov 17, 2023

@t4ccer
Alright, I have first maybe bug. If I have

sum NftMarketplaceRedeemer = Buy | Cancel

and run it through lbf-plutus-to-plutarch and try to compile, I'll get a GHC error saying

    • No instance for (Plutarch.Prelude.PlutusType
                         NftMarketplaceRedeemer)
        arising from the 'deriving' clause of a data type declaration
      Possible fix:
        use a standalone 'deriving instance' declaration,
          so you can specify the instance context yourself
    • When deriving the instance for (Plutarch.Show.PShow
                                        NftMarketplaceRedeemer)
   |
40 |   deriving anyclass Plutarch.Show.PShow
   |                     ^^^^^^^^^^^^^^^^^^

Of course adding derive PlutusData NftMarketplaceRedeemer fixes the issue, but I have a feeling that it should be caught before going to ghc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working codegen plutarch All things Plutarch
Projects
Status: Todo
Development

No branches or pull requests

1 participant