Opened 2 years ago

Closed 2 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 Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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: http://www.haskell.org/ghc/  :? 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 2 years ago by michalt

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

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.