[GHC] #13458: Panic with unsafeCoerce and -dcore-lint
GHC
ghc-devs at haskell.org
Mon Mar 20 19:46:14 UTC 2017
#13458: Panic with unsafeCoerce and -dcore-lint
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: goldfire
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 rwbarton):
If you change the type signature to `unsafeCoerce' :: Int# -> Int#` then
the generated core is
{{{
unsafeCoerce'
= (id @ Any)
`cast` (UnsafeCo representational Any Int#
-> UnsafeCo representational Any Int#
:: ((Any -> Any) :: *) ~R# ((Int# -> Int#) :: *))
}}}
Optimizing the coercion like this seems dubious when the new coercions are
ill-kinded.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13458#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list