Opened 6 years ago

Closed 6 years ago

#7516 closed bug (fixed)

GHC panic

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by simonpj)

data RunLength = Single Char | Multiple (Char, Int)  deriving(show)
encode'        :: String -> [RunLength]
encode'     [] = []
encode'  (x:xs) = if len == 1 then Single x : encode' xs else
                     Multiple (x, len) : encode' rest
                where (first, rest) = span (==x) xs
                      len = length first

[1 of 1] Compiling Main             ( 99_1.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.2 for x86_64-apple-darwin):
	nameModule show{tv abq4}

Please report this as a GHC bug:

I notice I mistyped Show as show, but I think it's better to report it since the compiler doesnt catch the error

Change History (2)

comment:1 Changed 6 years ago by simonpj

Description: modified (diff)
difficulty: Unknown

comment:2 Changed 6 years ago by simonpj

Resolution: fixed
Status: newclosed

Thanks; this is a duplicate of #7183, now fixed.

Note: See TracTickets for help on using tickets.