Skip to content

Entered absent argument (again)

Consider this program:

{-# LANGUAGE MagicHash, UnboxedTuples #-}
module Main where
import GHC.Exts

f :: (() -> (# Int#, () #)) -> ()
{-# NOINLINE f #-}
-- Strictness signature was (7.8.2)
--    <C(S(LS)), 1*C1(U(A,1*U()))>
-- I.e. calls k, but discards first component of result
f k = case k () of (# _, r #) -> r

g :: Int -> ()
g y = f (\n -> (# case y of I# y2 -> h (h (h (h (h (h (h y2)))))), n #))
   -- RHS is big enough to force worker/wrapper

{-# NOINLINE h #-}
h :: Int# -> Int#
h n = n +# 1#

main = print (g 1)

You'll get

bash$ ghc -O -o foo Foo.hs
bash$ ./foo
foo: Oops!  Entered absent arg w_s4vl Int

Ugh! This is the bug underlying this bug report.

I know what is going on.

Trac metadata
Trac field Value
Version 7.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information