[GHC] #15125: Typeclass instance selection depends on the optimisation level

GHC ghc-devs at haskell.org
Sun May 6 22:58:26 UTC 2018


#15125: Typeclass instance selection depends on the optimisation level
-------------------------------------+-------------------------------------
        Reporter:  nicuveo           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.2.2
      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 nicuveo):

 I do agree with you on never relying on INCOHERENT! I beg to disagree on
 the interpretation of the documentation, however. Sure, the INCOHERENT
 instance does not get eliminated, but the very next bullet point reads:

 > //If exactly one non-incoherent candidate remains, select it. If all
 remaining candidates are incoherent, select an arbitrary one. Otherwise
 the search fails (i.e. when more than one surviving candidate is not
 incoherent).//

 Since, out of the two candidates that remain, only one is not incoherent,
 the compiler should only pick that one. My understanding is therefore that
 this code should //always// print 42?

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


More information about the ghc-tickets mailing list