[GHC] #9163: Ptr should have a phantom role

GHC ghc-devs at haskell.org
Mon Jul 9 13:00:58 UTC 2018


#9163: Ptr should have a phantom role
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  7.10.1
       Component:  Compiler          |              Version:  7.8.2
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  roles/should_compile/Roles2
      Blocked By:                    |             Blocking:
 Related Tickets:  #9164             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dominic):

 BTW you can't coerce a CInt to an Int so why should you be able to coerce
 a Vector of CInts to a Vector of Int?

 {{{
 Prelude Data.Coerce Foreign.C.Types Data.Int> coerce (0 :: CInt) :: Int

 <interactive>:5:1: error:
     • Couldn't match representation of type 'Int32' with that of 'Int'
         arising from a use of 'coerce'
     • In the expression: coerce (0 :: CInt) :: Int
       In an equation for 'it': it = coerce (0 :: CInt) :: Int
 }}}

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


More information about the ghc-tickets mailing list