[GHC] #7323: decoding GADTs gives internal error: stg_ap_v_ret

GHC cvs-ghc at haskell.org
Mon Oct 22 18:48:51 CEST 2012


#7323: decoding GADTs gives internal error: stg_ap_v_ret
----------------------------+-----------------------------------------------
  Reporter:  heisenbug      |          Owner:                
      Type:  bug            |         Status:  closed        
  Priority:  normal         |      Milestone:  7.8.1         
 Component:  Compiler       |        Version:  7.7           
Resolution:  invalid        |       Keywords:                
        Os:  Linux          |   Architecture:  x86_64 (amd64)
   Failure:  Runtime crash  |     Difficulty:  Unknown       
  Testcase:  yes            |      Blockedby:                
  Blocking:                 |        Related:                
----------------------------+-----------------------------------------------
Changes (by igloo):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 `int-e` in #ghc diagnosed this:
 {{{
 GHC correctly infers that when it gets a value
 of type forall a. TypedPair a, then there is no constructor
 that can match.

 And it happily creates a case statement without alternatives,
 relying on the value to be bottom. The code, however, produces
 a non-bottom value of the type. What will happen then is
 unpredictable. (Interestingly, ghc 7.4.1 created a fresh
 bottom value instead, which is arguably more friendly.)
 }}}

 {{{
 Main.main :: GHC.Types.IO ()
 [GblId, Str=DmdType b]
 Main.main =
   case Unsafe.Coerce.unsafeCoerce
          @ (Main.TypedPair GHC.Types.Int)
          @ (Main.TypedPair (GHC.Prim.Any *))
          Main.$WTPInt
   of _ {
   }
 }}}

 This therefore looks like it isn't a bug - just an invalid use of
 `unsafeCoerce`.

 Thanks for taking the time to make such a small testcase, though. And
 thanks too to `int-e` for the diagnosis.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7323#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list