[GHC] #12407: Template Haskell thinks an unboxed tuple name is illegal to splice in
#12407: Template Haskell thinks an unboxed tuple name is illegal to splice in -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Template | Version: 8.0.1 Haskell | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{#!hs {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UnboxedTuples #-} module Bug where import Language.Haskell.TH.Lib import Language.Haskell.TH.Syntax $(do let ubxTup = conT (unboxedTupleTypeName 2) `appT` conT ''Int `appT` conT ''Int x <- newName "x" y <- newName "y" [d| f :: $(ubxTup) -> $(ubxTup) f $(conP (unboxedTupleDataName 2) [varP x, varP y]) = $(conE (unboxedTupleDataName 2) `appE` varE x `appE` varE y) |]) }}} {{{ $ /opt/ghc/8.0.1/bin/ghc Bug.hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) Bug.hs:8:3: error: Illegal type constructor or class name: ‘(#,#)’ When splicing a TH declaration: f_0 :: GHC.Tuple.(#,#) GHC.Types.Int GHC.Types.Int -> GHC.Tuple.(#,#) GHC.Types.Int GHC.Types.Int }}} Patch coming soon. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12407> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12407: Template Haskell thinks an unboxed tuple name is illegal to splice in -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: patch Priority: normal | Milestone: 8.0.2 Component: Template Haskell | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2410 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D2410 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12407#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12407: Template Haskell thinks an unboxed tuple name is illegal to splice in -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: patch Priority: normal | Milestone: 8.0.2 Component: Template Haskell | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2410 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ryan Scott <ryan.gl.scott@…>): In [changeset:"1fc41d3274b5bf62f027aa6c7df57998db494938/ghc" 1fc41d32/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="1fc41d3274b5bf62f027aa6c7df57998db494938" Make okConIdOcc recognize unboxed tuples Summary: `okConIdOcc`, which validates that a type or constructor name is valid for splicing using Template Haskell, has a special case for tuples, but neglects to look for unboxed tuples, causing some sensible Template Haskell code involving unboxed tuples to be rejected. Fixes #12407. Test Plan: make test TEST=T12407 Reviewers: austin, bgamari, hvr, goldfire Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2410 GHC Trac Issues: #12407 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12407#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12407: Template Haskell thinks an unboxed tuple name is illegal to splice in -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.2 Component: Template Haskell | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2410 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => merge -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12407#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12407: Template Haskell thinks an unboxed tuple name is illegal to splice in -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.2 Component: Template Haskell | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: th/T12407 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2410 Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => th/T12407 Comment: Thanks Ryan. Don't forget to fill in the test casel field on the ticket. (I have done so.) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12407#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12407: Template Haskell thinks an unboxed tuple name is illegal to splice in -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Template Haskell | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: th/T12407 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2410 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.0` as 422ed83c210e83acbd8f6b64ba725964d726f10a. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12407#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC