Skip to content

Exception when encountering instance declarations without class name

Code

instance Bounded b => (a -> b) where
 minBound = const minBound
 maxBound = const maxBound

GHC 7.4.1 "crashes" with an exception if the class name is missing.

*** Exception: compiler/rename/RnSource.lhs:429:14-81: Irrefutable pattern failed for pattern Data.Maybe.Just (inst_tyvars,
                                                        _,
                                                        SrcLoc.L _ cls,
                                                        _)
Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information