
//If exactly one non-incoherent candidate remains, select it. If all remaining candidates are incoherent, select an arbitrary one. Otherwise
#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: 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