Skip to content

Commit 41c8ae8

Browse files
committed
Make our repo buildable again with -O0.
1 parent 3fae582 commit 41c8ae8

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

doc/docusaurus/docusaurus-examples.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ common lang
1818
-Wall -Wnoncanonical-monad-instances -Wincomplete-uni-patterns
1919
-Wincomplete-record-updates -Wredundant-constraints -Widentities
2020
-Wunused-packages -Wmissing-deriving-strategies
21+
-fobject-code -fno-ignore-interface-pragmas -fno-omit-interface-pragmas
2122

2223
common ghc-version-support
2324
-- See the section on GHC versions in CONTRIBUTING

plutus-benchmark/nofib/src/PlutusBenchmark/NoFib/Knights/Sort.hs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{-# OPTIONS_GHC -fno-warn-unused-top-binds #-}
2+
{-# LANGUAGE NoImplicitPrelude #-}
3+
{-# LANGUAGE OverloadedStrings #-}
24

35
module PlutusBenchmark.NoFib.Knights.Sort
46
( insertSort,
57
mergeSort,
68
quickSort
79
) where
810

9-
import PlutusTx.Prelude qualified as Tx
11+
import PlutusTx.Prelude as Tx
12+
import PlutusTx.List as Tx
1013

1114
insertSort :: (Tx.Ord a) => [a] -> [a]
1215
insertSort xs = foldr insertion [] xs
@@ -24,8 +27,8 @@ mergeSort xs
2427
= if (n <=1 ) then xs
2528
else
2629
(mergeList
27-
( mergeSort (take (n `div` 2) xs))
28-
( mergeSort (drop (n `div` 2) xs)))
30+
( mergeSort (take (n `divide` 2) xs))
31+
( mergeSort (drop (n `divide` 2) xs)))
2932
where
3033
n = length xs
3134
{-# INLINABLE mergeSort #-}
@@ -98,9 +101,9 @@ randomIntegers s1 s2 =
98101
if 1 <= s2 && s2 <= 2147483398 then
99102
rands s1 s2
100103
else
101-
error "randomIntegers: Bad second seed."
104+
traceError "randomIntegers: Bad second seed."
102105
else
103-
error "randomIntegers: Bad first seed."
106+
traceError "randomIntegers: Bad first seed."
104107
{-# INLINABLE randomIntegers #-}
105108

106109
rands :: Integer -> Integer -> [Integer]
@@ -109,11 +112,11 @@ rands s1 s2
109112
else
110113
z : rands s1'' s2''
111114
where
112-
k = s1 `div` 53668
115+
k = s1 `divide` 53668
113116
s1' = 40014 * (s1 - k * 53668) - k * 12211
114117
s1'' = if s1' < 0 then s1' + 2147483563 else s1'
115118

116-
k' = s2 `div` 52774
119+
k' = s2 `divide` 52774
117120
s2' = 40692 * (s2 - k' * 52774) - k' * 3791
118121
s2'' = if s2' < 0 then s2' + 2147483399 else s2'
119122

plutus-tx-plugin/test/CallTrace/OtherModule.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ class MyClassInOtherModule a where
1616
myClassFuncInOtherModule :: a -> BuiltinString
1717

1818
instance MyClassInOtherModule Integer where
19-
myClassFuncInOtherModule 8 = wraps True
20-
myClassFuncInOtherModule _ = error ()
19+
myClassFuncInOtherModule x
20+
-- no case on integer here, because our compiler cannot manage it
21+
| x == 8 = wraps True
22+
| otherwise = error ()
2123

2224
instance MyClassInOtherModule () where
2325
myClassFuncInOtherModule () = error ()

0 commit comments

Comments
 (0)