Skip to content

Build failure on HEAD after "ghc-heap: Don't Box NULL pointers" commit

After commit ghc@cadd7753, ghc-debug-common now fails to build, as seen in the following head.hackage CI job:

[5 of 8] Compiling GHC.Debug.Decode.Convert ( src/GHC/Debug/Decode/Convert.hs, dist/build/GHC/Debug/Decode/Convert.o, dist/build/GHC/Debug/Decode/Convert.dyn_o )
src/GHC/Debug/Decode/Convert.hs:47:38: error:
    • Couldn't match type ‘a’ with ‘Maybe a’
      Expected: Maybe a
        Actual: Maybe (Maybe a)
      ‘a’ is a rigid type variable bound by
        the type signature for:
          convertClosure :: forall a.
                            (Num a, Eq a, Show a) =>
                            StgInfoTableWithPtr
                            -> GHC.GenClosure a -> DebugClosure Void InfoTablePtr Void a
        at src/GHC/Debug/Decode/Convert.hs:11:1-123
    • In the sixth argument of ‘WeakClosure’, namely ‘w_link’
      In the expression: WeakClosure itb a2 a3 a4 a5 w_link
      In the expression:
        let w_link = if a6 == 0 then Nothing else Just a6
        in WeakClosure itb a2 a3 a4 a5 w_link
    • Relevant bindings include
        w_link :: Maybe (Maybe a)
          (bound at src/GHC/Debug/Decode/Convert.hs:44:11)
        a6 :: Maybe a (bound at src/GHC/Debug/Decode/Convert.hs:42:35)
        a5 :: a (bound at src/GHC/Debug/Decode/Convert.hs:42:32)
        a4 :: a (bound at src/GHC/Debug/Decode/Convert.hs:42:29)
        a3 :: a (bound at src/GHC/Debug/Decode/Convert.hs:42:26)
        a2 :: a (bound at src/GHC/Debug/Decode/Convert.hs:42:23)
        (Some bindings suppressed; use -fmax-relevant-binds=N or -fno-max-relevant-binds)
   |
47 |       in WeakClosure itb a2 a3 a4 a5 w_link
   |                                      ^^^^^^