#4166: unsafeCoerce#'s kind is not as liberal enough to inspect tag bits.
------------------------------+---------------------------------------------
  Reporter:  ekmett           |          Owner:                  
      Type:  feature request  |         Status:  closed          
  Priority:  normal           |      Milestone:                  
 Component:  Compiler         |        Version:  6.12.3          
Resolution:  worksforme       |       Keywords:                  
Difficulty:                   |             Os:  Unknown/Multiple
  Testcase:                   |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown     |  
------------------------------+---------------------------------------------
Changes (by simonmar):

  * status:  new => closed
  * resolution:  => worksforme


Comment:

 Happily, this already works.

 {{{
 Prelude> import GHC.Exts
 Prelude GHC.Exts> let x = I# (unsafeCoerce# True :: Int#)
 Prelude GHC.Exts> x
 1098195192
 }}}

 it works because `unsafeCoerce#` is not really a primop at all, but a
 built-in identifier, and the type variables have the "open" kind (can be
 instantiated by any type at all).

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4166#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to