Skip to content

Commit

Permalink
Suggest Integer instead of Int for Lift and Typeable
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Akentev committed May 12, 2021
1 parent 7a581dc commit 9a0c24b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plutus-tx/src/PlutusTx/Lift/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
Expand All @@ -22,6 +23,8 @@ import PlutusIR.MkPir
import qualified Data.ByteString as BS
import Data.Proxy

import GHC.TypeLits (ErrorMessage (..), TypeError)

-- Derived instances

-- This instance ensures that we can apply typeable type constructors to typeable arguments and get a typeable
Expand Down Expand Up @@ -61,6 +64,14 @@ liftBuiltin
=> a -> RTCompile uni fun (Term TyName Name uni fun ())
liftBuiltin = pure . mkConstant ()

instance (TypeError ('Text "Int is not supported, use Integer instead"))
=> Typeable uni Int where
typeRep = Prelude.error "unsupported"

instance (TypeError ('Text "Int is not supported, use Integer instead"))
=> Lift uni Int where
lift = Prelude.error "unsupported"

instance uni `PLC.Includes` Integer => Typeable uni Integer where
typeRep = typeRepBuiltin

Expand Down

0 comments on commit 9a0c24b

Please sign in to comment.