[GHC] #16246: GHC HEAD-only Core Lint error with unboxed equality (Non-CoVar has coercion type)

GHC ghc-devs at haskell.org
Mon Jan 28 21:57:34 UTC 2019


#16246: GHC HEAD-only Core Lint error with unboxed equality (Non-CoVar has coercion
type)
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.10.1
       Component:  Compiler          |              Version:  8.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15648            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 We need the distinction -- if ordinary `Id`s could represent coercions,
 then nothing is stopping us from having non-terminating coercions, which
 would kill the type system. (Note that we don't force `CoVar`s when
 casting by them, as they're computationally irrelevant.)

 But, there is nothing harmful (or useful, I think) about ordinary `Id`s
 that have coercion types. As these are not `CoVar`s, they cannot be used
 in casts (or anywhere else). But I don't see them causing any harm.

 So, all I'm really worried about is the possibility that someone,
 somewhere checks whether {{{tyConAppTyCon (idType id) `hasKey`
 eqPrimTyConKey}}} (or something) instead of checking `isCoVar id`. If we
 don't ever do that, then an `Id` with a coercion type is just fine.

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


More information about the ghc-tickets mailing list