[GHC] #13674: GHC doesn't discharge heterogeneous equality constraint when it ought to

GHC ghc-devs at haskell.org
Wed May 10 15:05:57 UTC 2017


#13674: GHC doesn't discharge heterogeneous equality constraint when it ought to
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
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 goldfire):

 The original program is wrong, but the error message also is wrong.
 Because `Lcm` is a nullary type family, the constraint `m ~ Lcm m m` is
 morally equivalent to `m ~ Either m m`. This constraint is an occurs-check
 failure and is surely going to lead to an error. It seems that the error-
 reporting code is mischaracterizing it, though.

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


More information about the ghc-tickets mailing list