[GHC] #15800: Overlapping instances error with single instance

GHC ghc-devs at haskell.org
Thu Oct 25 21:20:36 UTC 2018


#15800: Overlapping instances error with single instance
-------------------------------------+-------------------------------------
        Reporter:  roland            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by roland):

 Thanks, this indeed clarifies things! I was trying to trigger the search
 procedure with `C a Int` as the target constraint. It seems that for the
 ambiguity check it ended up not only as the target, but also as one of the
 givens, at which point the error is to be expected. Replacing `()` with
 `a` (thus making the type non-ambiguous) or adding the AllowAmbiguousTypes
 pragma both make the program type-check.

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


More information about the ghc-tickets mailing list