Skip to content

GHC Panic in ByteCodeGen

Try to load the following problem with ghc --interactive of the latest HEAD.

{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}

class Search id a where
  search :: a -> ()

instance Search id () where
  search d = undefined

-- works:
-- instance Search () () where  search d = undefined

You get an irrefutable pattern match error in ByteCodeGen:644

The code calls splitApp and expects an AnnVar v. What it gets instead is:

\ (@ id{tv af0} [sk]) -> search1{v rfK} [gid] @ id{tv af0} [sk]

The argument to splitApp was:

((((\ (@ id{tv af0} [sk]) ->
          search1{v rfK} [gid] @ id{tv af0} [sk])
       `cast` (forall id{tv af0} [sk].
               ghc-prim:GHC.Prim.sym{(w) tc 34v}
                 (main:Main.NTCo:T:Search{tc rfe}
                    id{tv af0} [sk] ghc-prim:GHC.Unit.(){(w) tc 40})
               :: <pred>forall id{tv af0} [sk].
                        ghc-prim:GHC.Unit.(){(w) tc 40} -> ghc-prim:GHC.Unit.(){(w) tc 40}
                          ~
                        forall id{tv af0} [sk].
                        main:Main.T:Search{tc rf8}
                          id{tv af0} [sk] ghc-prim:GHC.Unit.(){(w) tc 40}))
        @ etaT_sg1{tv} [tv])
     `cast` (main:Main.NTCo:T:Search{tc rfe}
               etaT_sg1{tv} [tv] ghc-prim:GHC.Unit.(){(w) tc 40}
             :: <pred>main:Main.T:Search{tc rf8}
                        etaT_sg1{tv} [tv] ghc-prim:GHC.Unit.(){(w) tc 40}
                        ~
                      ghc-prim:GHC.Unit.(){(w) tc 40}
                      -> ghc-prim:GHC.Unit.(){(w) tc 40}))
      eta_sg2{v} [lid]
Trac metadata
Trac field Value
Version 6.11
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