[GHC] #8807: Variable constraints not handled properly in TH
#8807: Variable constraints not handled properly in TH ------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Template Haskell | Version: 7.9 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- When I compile {{{ {-# LANGUAGE TemplateHaskell, ConstraintKinds #-} module Scratch where import Data.Proxy foo :: $( [t| a b => Proxy a -> b -> b |] ) foo = undefined }}} I get {{{ Illegal type constructor or class name: ‛a’ When splicing a TH type: forall a_0 b_1 . a_0 b_1 => Data.Proxy.Proxy a_0 -> b_1 -> b_1 In the splice: $([t| a b => Proxy a -> b -> b |]) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8807> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8807: Variable constraints not handled properly in TH -------------------------------------+------------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Template Haskell | Version: 7.9 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Richard Eisenberg <eir@…>): In [changeset:"98b6756b09194352aa2ccfbb624992150a7a3520/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="98b6756b09194352aa2ccfbb624992150a7a3520" Fix #8807. It turns out that the enhanced repPred function in DsMeta assumed that the head of any constraint would be a tycon. This assumption is false. Happily, the solution involved *deleting* code. I just removed repPred in favor of repTy, and added the HsEqTy case to repTy, where it should be anyway. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8807#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8807: Variable constraints not handled properly in TH -------------------------------------+------------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Template Haskell | Version: 7.9 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by goldfire): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8807#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC