plutus icon indicating copy to clipboard operation
plutus copied to clipboard

Plutus.V1.Ledger.Value uses OverloadedLists

Open phadej opened this issue 2 years ago • 2 comments

Summary

... and sometimes when GHC does (or doesn't) something the code using that module fails to compile:

GHC Core to PLC plugin: E042:Error: Unsupported feature: Irreducible type family application: GHC.Exts.Item
Context: Compiling type: GHC.Exts.Item
                           [(Plutus.V1.Ledger.Value.CurrencySymbol,
                             PlutusTx.AssocMap.Map
                               Plutus.V1.Ledger.Value.TokenName GHC.Integer.Type.Integer)]

cc @brunjlar

Steps to reproduce the behavior

write scripts. In case I see, GHC produces coercions from [GHC.Exts.Item ...] to [(CurrencySymbol, AssocMap TokenName Integer)]. In other words, GHC doesn't see any reason to reduce Item type-family as it is just an intermediate type.

Actual Result

Expected Result

compilation works.

Describe the approach you would take to fix this

don't use OverloadedLists in plutus code.

System info

phadej avatar Apr 04 '22 11:04 phadej

We are constantly hit by this bug. It's hard to reproduce as it seems to happen in incremental builds.

Please don't use OverloadedLists in plutus code (or make plutux-tx-plugin able to handle it).

phadej avatar Jul 21 '22 17:07 phadej

This is is resolved in master.

bezirg avatar Jul 29 '22 14:07 bezirg

@bezirg Could you please link to a PR/commit that fixed this issue?

KristianBalaj avatar Sep 20 '22 17:09 KristianBalaj

@KristianBalaj it is the commit 4e0d6ed332b782367e68510808c38de90e04343c . The file change is https://github.com/input-output-hk/plutus/commit/4e0d6ed332b782367e68510808c38de90e04343c#diff-3b8075ee5603b10864a2c007bce39918b864164c81b94315607541f634203990

bezirg avatar Sep 26 '22 12:09 bezirg

@KristianBalaj Do you still run into a similar issue and needs to be reopened?

bezirg avatar Sep 26 '22 12:09 bezirg

@bezirg sorry for the late reply, I've missed a notification.

No need to reopen I've checked whether the https://github.com/input-output-hk/plutus/commit/4e0d6ed332b782367e68510808c38de90e04343c commit hash is in the git log of this commit of plutus we're using https://github.com/input-output-hk/plutus/commit/a56c96598b4b25c9e28215214d25189331087244 It seems it's not. So it's okay that we're still experiencing the error.

KristianBalaj avatar Oct 05 '22 17:10 KristianBalaj