[GHC] #8759: Pattern synonyms and TH

#8759: Pattern synonyms and TH -----------------------------------+--------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time crash Unknown/Multiple | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | -----------------------------------+--------------------------------------- This file {{{ {-# LANGUAGE PatternSynonyms, TemplateHaskell #-} x = [d|pattern P = ()|] }}} causes a panic. Until TH supports pattern synonyms we should give a sensible error message. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8759 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8759: Pattern synonyms and TH ---------------------------------------+----------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time crash | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ---------------------------------------+----------------------------------- Comment (by monoidal): Is this quick fix OK? {{{ diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index 56fba14..8504892 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -1238,7 +1238,8 @@ rep_bind (L _ (VarBind { var_id = v, var_rhs = e})) ; return (srcLocSpan (getSrcLoc v), ans) } rep_bind (L _ (AbsBinds {})) = panic "rep_bind: AbsBinds" -rep_bind (L _ (PatSynBind {})) = panic "rep_bind: PatSynBind" +rep_bind (L _ (PatSynBind {})) = + sorry "Template Haskell does not yet support pattern synonyms." ----------------------------------------------------------------------------- -- Since everything in a Bind is mutually recursive we need rename all -- all the variables simultaneously. For example: }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8759#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8759: Pattern synonyms and TH ---------------------------------------+----------------------------------- Reporter: monoidal | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time crash | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ---------------------------------------+----------------------------------- Changes (by goldfire): * owner: => goldfire Comment: Not quite, I'm afraid. * It's better to use `notHandled` than `sorry` in !DsMeta * !TcSplice also has to be updated. The following code also panics: {{{ pattern P = () $( do info <- reify 'P reportWarning (show info) return [] ) }}} I'm happy to put in the fixes. I've got a bunch of others that I've put in today. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8759#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8759: Pattern synonyms and TH
---------------------------------------+-----------------------------------
Reporter: monoidal | Owner: goldfire
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.7
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time crash | Unknown/Multiple
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets:
---------------------------------------+-----------------------------------
Comment (by Richard Eisenberg

#8759: Pattern synonyms and TH ---------------------------------------+----------------------------------- Reporter: monoidal | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time crash | Unknown/Multiple Test Case: th/T8759 | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8761 ---------------------------------------+----------------------------------- Changes (by goldfire): * status: new => merge * testcase: => th/T8759 * related: => #8761 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8759#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8759: Pattern synonyms and TH ---------------------------------------+----------------------------------- Reporter: monoidal | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time crash | Unknown/Multiple Test Case: th/T8759 | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8761 ---------------------------------------+----------------------------------- Changes (by goldfire): * version: 7.7 => 7.8.1-rc1 * milestone: => 7.8.1 Comment: Putting this on Austin's radar for 7.8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8759#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8759: Pattern synonyms and TH ---------------------------------------+----------------------------------- Reporter: monoidal | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time crash | Unknown/Multiple Test Case: th/T8759 | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8761 ---------------------------------------+----------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8759#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC