Opened 5 years ago

Closed 5 years ago

#6051 closed bug (duplicate)

Parsing type constraints in GHC 7.4.1

Reported by: leepike Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.1
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This appears to be a parsing bug, or at least a bad error message, for a *malformed* type constraint:

Given the following malformed program, I get the following output loading it with ghci (GHC 7.4.1):

module Test where

data Foo a = Foo a

-- Malformed!
instance Ord a => Eq a => Show (Foo a) where
  show (Foo a) = undefined

$ ghci Test.hs 
GHCi, version 7.4.1:  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Test             ( Test.hs, interpreted )
*** Exception: compiler/rename/RnSource.lhs:429:14-81: Irrefutable pattern failed for pattern Data.Maybe.Just (inst_tyvars,
                                                        SrcLoc.L _ cls,


Change History (1)

comment:1 Changed 5 years ago by michalt

Resolution: duplicate
Status: newclosed

Thanks for reporting! Seems to be same problem as in #5951, which is already fixed. Please do reopen if you think this is different.

Note: See TracTickets for help on using tickets.