Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#8936 closed bug (duplicate)

Irrefutable pattern failed in ghc 7.4.1

Reported by: gahuber95 Owned by:
Priority: normal Milestone: 7.6.1
Component: Compiler Version: 7.4.1
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description (last modified by hvr)

Thanks for your attention! Gary (newbie)

class Show a => Show_Listable a where
  show_list ::  [a] -> IO()


instance Show_Listable a -> Show a where
  show_list lst = do 
    print "gen list";
    print lst  

lst :: Int -> [Int]
lst i = [1,2,3] 

main = do
    show_list (lst 1)

Output:

$ ghc bull.hs -o bull
[1 of 1] Compiling Main             ( bull.hs, bull.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
	compiler/rename/RnSource.lhs:429:14-81: Irrefutable pattern failed for pattern Data.Maybe.Just (inst_tyvars,
                                                        _,
                                                        SrcLoc.L _ cls,
                                                        _)


Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Change History (2)

comment:1 Changed 15 months ago by monoidal

  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the report. This is already fixed in GHC 7.6: #5951. In instances you should use "=>", not "->" (though, this is not the only issue).

Last edited 15 months ago by monoidal (previous) (diff)

comment:2 Changed 15 months ago by hvr

  • Cc hvr removed
  • Component changed from GHCi to Compiler
  • Description modified (diff)
  • Milestone set to 7.6.1
Note: See TracTickets for help on using tickets.