#5366: UNPACK is paranoid about a phantom type argument
---------------------------------+------------------------------------------
    Reporter:  ekmett            |       Owner:                           
        Type:  bug               |      Status:  new                      
    Priority:  normal            |   Component:  Compiler                 
     Version:  7.0.3             |    Keywords:                           
    Testcase:                    |   Blockedby:                           
          Os:  Unknown/Multiple  |    Blocking:                           
Architecture:  Unknown/Multiple  |     Failure:  GHC rejects valid program
---------------------------------+------------------------------------------
 Attempting to use code with a phantom type like the following:

 {{{
 newtype Id a = Id Int
 }}}

 inlines fine into

 {{{
 data Foo = Foo {-# UNPACK #-} !(Id Foo) String
 }}}

 but when I go to inline THAT

 {{{
 data Bar = Bar {-# UNPACK #-} !Foo
 }}}

 GHC tells me no, even though the recursive use of Foo is only through a
 phantom type.

 {{{
 Distilled.hs:3:12:
     Warning: Ignoring unusable UNPACK pragma on the
              first argument of `Bar'
     In the definition of data constructor `Bar'
     In the data type declaration for `Bar'
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5366>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to