Skip to content

Panic when building xmonad-contrib 0.17.1 with a debug enabled GHC 9.4

Only happens on debug enabled builds of GHC because zipEqual ignore excess arguments otherwise

[ 56 of 308] Compiling XMonad.Layout.LimitWindows ( XMonad/Layout/LimitWindows.hs, dist/build/XMonad/Layout/LimitWindows.o, dist/build/XMonad/Layout/LimitWindows.dyn_o )

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.4.7:
	zipEqual: unequal lists: getStrictConArgs

Here is the call to getStrictConArgs:

rewriteConApp :: InferStgExpr -> RM TgStgExpr
rewriteConApp (StgConApp con cn args tys) = do
    -- We check if the strict field arguments are already known to be tagged.
    -- If not we evaluate them first.
    fieldInfos <- mapM isArgTagged args
    let strictIndices = getStrictConArgs con (zip fieldInfos args) :: [(Bool, StgArg)]
    let needsEval = map snd . filter (not . fst) $ strictIndices :: [StgArg]
    let evalArgs = [v | StgVarArg v <- needsEval] :: [Id]
    if (not $ null evalArgs)
        then do
            -- pprTraceM "Creating conAppSeqs for " $ ppr nodeId <+> parens ( ppr evalArgs ) -- <+> parens ( ppr fieldInfos )
            mkSeqs args evalArgs (\taggedArgs -> StgConApp con cn taggedArgs tys)
        else return $! (StgConApp con cn args tys)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information