Ticket #2866 (closed bug: duplicate)

Opened 4 years ago

Last modified 4 years ago

panic with GADTs + NoMonomorphismRestriction

Reported by: ganesh Owned by: igloo
Priority: normal Milestone:
Component: Compiler Version: 6.10.1
Keywords: Cc: ganesh@…
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The program below causes

ganesh@defoe:~/temp$ ghc -c Test.hs
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.1 for i386-unknown-linux):
        initC: srt_lbl

with ghc, and

*Test> E 5
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.1 for i386-unknown-linux):
        nameModule xs{v afT}

with ghci

The problem goes away with ghc -O.

{-# LANGUAGE GADTs, NoMonomorphismRestriction #-}
module Test where

data Expr a = E Int
  deriving Show

data IsSeq a where
   IsSeq :: IsSeq [a]

isSeq :: Expr a -> IsSeq a
isSeq = undefined

mkSeq :: [Expr [a]] -> Expr [a]
mkSeq = undefined

unSeq :: Expr [a] -> [Expr [a]]
unSeq = undefined

sequenceEquality :: Expr a -> Expr a
sequenceEquality x = case isSeq x of
                             IsSeq -> let xs = unSeq x in mkSeq xs

Change History

Changed 4 years ago by simonpj

  • owner set to igloo
  • difficulty set to Unknown

Thanks. I'm 99% certain that this is a dup of #2799, which has been fixed.

Ian, can you just check that this program works on the 6.10 branch, and then close? It is certainly OK in the HEAD.

Simon

Changed 4 years ago by ganesh

  • status changed from new to closed
  • resolution set to duplicate

Thanks, I've confirmed this is ok on my original program with 6.10.1.20081209

Apologies for the dupe - I did search trac for the message, but for some unknown reason concluded that because all the bugs in the results page were crossed out, they couldn't be relevant!

Note: See TracTickets for help on using tickets.