Skip to content

Commit

Permalink
Fix (decimal, integer) case not warning, and incorrect warning on (De…
Browse files Browse the repository at this point in the history
…cimal, decimal) (#1134)

* json instances for pactwarning

* fix integer/decimal warning
  • Loading branch information
jmcardon committed Feb 3, 2023
1 parent 59a4784 commit 64d5845
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Pact/Native/Ops.hs
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,14 @@ binop
binop ndef dop iop fi as@[TLiteral a _,TLiteral b _] = do
case (a,b) of
(LInteger i,LInteger j) -> toTerm <$> (i `iop` j)
(LDecimal i,LDecimal j) -> do
emitPactWarning $ DeprecatedOverload ndef "decimal/integer operator overload is deprecated"
(LDecimal i,LDecimal j) ->
toTerm <$> (i `dop` j)
(LInteger i,LDecimal j) -> do
emitPactWarning $ DeprecatedOverload ndef "decimal/integer operator overload is deprecated"
toTerm <$> (fromIntegral i `dop` j)
(LDecimal i,LInteger j) -> toTerm <$> (i `dop` fromIntegral j)
(LDecimal i,LInteger j) -> do
emitPactWarning $ DeprecatedOverload ndef "decimal/integer operator overload is deprecated"
toTerm <$> (i `dop` fromIntegral j)
_ -> argsError fi as
binop _ _ _ fi as = argsError fi as
{-# INLINE binop #-}
Expand Down

0 comments on commit 64d5845

Please sign in to comment.