James Browning reported this issue.
In an earlier plutus version I was able to compile (\_ _ -> ()) or (\_ _ _ -> ()) but this now produces an error
GHC Core to PLC plugin: Error: Unsupported feature: Kind: forall k. k
Context: Compiling kind: forall k. k
Context: Compiling type: GHC.Types.Any
Context: Compiling expr: \ _ [Occ=Dead] _ [Occ=Dead] -> GHC.Tuple.()
Using a BuiltinData -> BuiltinData -> () function still works. Just wondered why this might be and if we care enough
For example, I used to use
alwaysSucceedPolicy :: MintingPolicy
alwaysSucceedPolicy = mkMintingPolicyScript $$(PlutusTx.compile [|| (\_ _ -> ()) ||])
but now I must do like
mkAlwaysSucceedPolicy :: BuiltinData -> BuiltinData -> ()
mkAlwaysSucceedPolicy _datum _sc = ()
alwaysSucceedPolicy :: SerialisedScript
alwaysSucceedPolicy = serialiseCompiledCode $$(PlutusTx.compile [|| mkAlwaysSucceedPolicy ||])
I think it wouldn’t be surprising if we couldn’t compile a naked \_ _ -> () however mkMintingPolicyScript does constrain the type of each argument bound by a lambda to BuiltinData, so in theory all types are there and GHC should be able to see them. In practice it may of course all be much more complicated than that.
Would be great to make it work, but perhaps not a huge deal if we can’t.
James Browning reported this issue.
In an earlier plutus version I was able to compile
(\_ _ -> ())or(\_ _ _ -> ())but this now produces an errorUsing a
BuiltinData -> BuiltinData -> ()function still works. Just wondered why this might be and if we care enoughFor example, I used to use
but now I must do like
I think it wouldn’t be surprising if we couldn’t compile a naked
\_ _ -> ()howevermkMintingPolicyScriptdoes constrain the type of each argument bound by a lambda toBuiltinData, so in theory all types are there and GHC should be able to see them. In practice it may of course all be much more complicated than that.Would be great to make it work, but perhaps not a huge deal if we can’t.