1

I mark the function as inlinable but get the error that the function cannot be made inlinable. This does not appear to make sense as the function is known to be inlinable.

1 Answer 1

1

This was a problem with the Haskell compiler interfering with the code before it reached the Plutus compiler. The changes made in the Haskell compiler made it impossible to compile in Plutus.

This means the plugin doesn’t have access to implementation of the function, which it needs to be able to compile the function to Plutus Core. Some things you can do to fix it:

Make sure to add {-# INLINABLE functionname #-} to your function.

If there’s an extra $c in front of the function name in the error, GHC has generated a specialised version of your function, which prevents the plugin from accessing it. You can turn off specialisation with {-# OPTIONS_GHC -fno-specialise #-}

Other compiler options that can help:

{-# OPTIONS_GHC -fno-strictness #-}

{-# OPTIONS_GHC -fno-ignore-interface-pragmas #-}

{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}

{-# OPTIONS_GHC -fobject-code #-}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.