#5332: Template Haskell drops singleton unboxed tuples
---------------------------------+------------------------------------------
    Reporter:  reinerp           |       Owner:                             
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Component:  Template Haskell           
     Version:  7.1               |    Keywords:                             
    Testcase:                    |   Blockedby:                             
          Os:  Unknown/Multiple  |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  GHC accepts invalid program
---------------------------------+------------------------------------------
 The following module compiles with Ghc HEAD, but shouldn't:

 {{{
 {-# LANGUAGE TemplateHaskell, UnboxedTuples #-}
 module Tuple where

 import Language.Haskell.TH

 f :: Int
 f = $( [| (# 0 #) |] )
 }}}

 In hsSyn/Convert.lhs, we can see why this is happening; we have a handful
 of lines like this:

 {{{
 ...
     cvt (UnboxedTupE [e])     = cvt e   -- Singleton tuples treated like
 nothing (just parens)
 ...
 }}}

 This is correct for boxed tuples, but not for unboxed tuples.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5332>
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