[GHC] #7903: Failure to find class instance specified with extra parentheses

#7903: Failure to find class instance specified with extra parentheses -----------------------------+---------------------------------------------- Reporter: conal | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- The following two-line program fails to compile under GHC 7.6.3 and compiles fine with GHC 7.4.1: {{{ instance Eq (((->) a) b) instance (Ord b) => Ord (((->) a) b) }}} Error message: {{{ Could not deduce (Eq (a -> b)) arising from the superclasses of an instance declaration from the context (Ord b) }}} Compilation goes through if I tweak the {{{Eq}}} instance to use "{{{((->) a b)}}}" or "{{{(a -> b)}}}" in place of "{{{(((->) a) b)}}}". -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7903 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7903: Failure to find class instance specified with extra parentheses
-----------------------------+----------------------------------------------
Reporter: conal | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.6.3 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Blockedby:
Blocking: | Related:
-----------------------------+----------------------------------------------
Comment(by simonpj@…):
commit fe389f502481c90e3a69f04924f8fa393b83ba43
{{{
Author: Simon Peyton Jones

#7903: Failure to find class instance specified with extra parentheses -----------------------------+---------------------------------------------- Reporter: conal | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by parcs): Hi Simon, Note that changing {{{ instance Eq (((->) a) b) }}} to {{{ instance Eq (((->) a :: * -> *) b) }}} causes the error to reappear. And in this case you can't have `splitHsAppTys` look through kind signatures as well because then the kind signature can't be checked in `tc_hs_type` since it will be discarded. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7903#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7903: Failure to find class instance specified with extra parentheses ---------------------------------+------------------------------------------ Reporter: conal | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: typecheck/should_compile/T7903 Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by simonpj): * testcase: => typecheck/should_compile/T7903 * difficulty: => Unknown Comment: Dead right. I need to think again. This really is a very tiresome corner! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7903#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC