[GHC] #16114: strange "instance .. => .. => .. where ..."

GHC ghc-devs at haskell.org
Tue Jan 8 12:10:13 UTC 2019


#16114: strange "instance .. => .. => .. where ..."
-------------------------------------+-------------------------------------
        Reporter:  j.waldmann        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Some history on this ticket: you committed
 1c062b794bf71a329f65813ce7b72fe2bd3935f0 after I complained (in
 https://phabricator.haskell.org/D4383#122346) that `rnLHsInstType` was
 overly complicated due to the previous validity checking. You responded
 (in https://phabricator.haskell.org/D4383#122347) that it was safe to
 remove this validity check from `rnLHsInstType` altogether, as
 `checkValidInstance` apparently performs the same check. I'm not sure if
 that was true at one point in time, but it certainly doesn't appear to be
 true as of GHC 8.6.

 As you say, we could certainly put the check back into `rnLHsInstType`.
 But to be honest, that might cause an overall regression in error message
 quality, judging from the changes to error messages (generally for the
 better) in commit 1c062b794bf71a329f65813ce7b72fe2bd3935f0.

 Another option would be to re-investigate `checkValidInstance`, confirm
 whether or not it checks for instances of the form `Eq a => Eq a => Eq (T
 a)`, and if not, add a check for it and see if it fires before we get this
 `Class ‘Eq’ does not have a method ‘==’` nonsense.

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


More information about the ghc-tickets mailing list