Commit 3b31a94d authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

testsuite: Add testsuite for #16978

parent 7d8d0012
-- | Caused Core Lint failure due to floating of unlifted join point to the
-- top-level.
module Bug where
import Control.Monad.Trans.State.Strict (State, modify')
import Data.Text (Text)
import qualified Data.Text.Lazy.Builder as B
data Value = String !Text | Null
type Render a = State B.Builder a
tellBuilder :: B.Builder -> Render ()
tellBuilder b' = modify' f where
f b = b <> b'
renderNode :: Value -> Render ()
renderNode v =
renderValue v >>= outputRaw
outputRaw :: Text -> Render ()
outputRaw = tellBuilder . B.fromText
{-# INLINE outputRaw #-}
renderValue :: Value -> Render Text
renderValue v = case v of
String str -> return str
_ -> let x = x in x
{-# INLINE renderValue #-}
......@@ -305,5 +305,6 @@ test('T16288', normal, multimod_compile, ['T16288B', '-O -dcore-lint -v0'])
test('T16348', normal, compile, ['-O'])
test('T16918', normal, compile, ['-O'])
test('T16918a', normal, compile, ['-O'])
test('T16978', normal, compile, ['-O'])
test('T16979a', normal, compile, ['-O'])
test('T16979b', normal, compile, ['-O'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment