[GHC] #9415: Superclass cycle with ambiguous type causes loop

GHC ghc-devs at haskell.org
Wed Aug 6 13:38:23 UTC 2014


#9415: Superclass cycle with ambiguous type causes loop
-------------------------------------+-------------------------------------
       Reporter:  goldfire           |                   Owner:  goldfire
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler           |                 Version:  7.9
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:
     Blocked By:                     |  None/Unknown
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 If I say

 {{{
 class D a => C a where
   meth :: D a => ()
 class C a => D a
 }}}

 I get a loop in the typechecker.

 I know what's going on here: the error for the superclass cycle is added
 during the validity check, but then we go on to do ambiguity checks.
 Unfortunately, the ambiguity check never finishes. We just need to bail
 when there are superclass errors before doing the ambiguity check.

 Patch on the way.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9415>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list