Ticket #7039 (closed bug: duplicate)
Panic due 'instance Foo a => Bar a => Baz a' style declarations
Description
class Foo a
instance Show a => Num a => Foo a where
foo = undefined
results in
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.2 for x86_64-unknown-linux):
compiler/rename/RnSource.lhs:430:14-81: Irrefutable pattern failed for pattern Data.Maybe.Just (inst_tyvars,
_,
SrcLoc.L _ cls,
_)
It doesn't matter whether foo is declared in the class definition or not.
Things that work:
1. tuple-style context
2. not defining foo in the instance: Not crashing, but complaining about a malformed head, which might or might not be the right thing to do, considering
3.
foo :: Show a => Num a => a foo = undefined
Change History
Note: See
TracTickets for help on using
tickets.
