[GHC] #13458: Panic with unsafeCoerce and -dcore-lint

GHC ghc-devs at haskell.org
Mon Mar 20 06:53:21 UTC 2017


#13458: Panic with unsafeCoerce and -dcore-lint
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 I think the trouble here is that the (properly uninhabited) type

 {{{#!hs
 forall (r :: RuntimeRep)
        (a :: TYPE r) (b :: TYPE r).
        a -> b
 }}}

 has kind `*`, so `unsafeCoerce` happily accepts it as a target. But then
 when `unsafeCoerce` inlines, core lint sees `unsafeCoerce#` being used in
 a bogus fashion.

 Question: do representation-polymorphic functions need to get non-`*`
 kinds?

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


More information about the ghc-tickets mailing list