[GHC] #9867: PatternSynonyms + ScopedTypeVariables triggers an internal error

GHC ghc-devs at haskell.org
Sun Dec 14 15:29:17 UTC 2014


#9867: PatternSynonyms + ScopedTypeVariables triggers an internal error
-------------------------------------+-------------------------------------
              Reporter:  antalsz     |            Owner:  cactus
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
  (Type checker)                     |         Keywords:  pattern synonyms
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  Compile-    |  Related Tickets:
  time crash                         |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by cactus):

 Some brainstorming:

 The patsyn builders are typechecked from this code:

 {{{
 (binds', (extra_binds', thing)) <- tcBindGroups top_lvl sig_fn prag_fn
 binds $ do
      { thing <- thing_inside
        -- See Note [Pattern synonym builders don't yield dependencies]
      ; patsyn_builders <- mapM tcPatSynBuilderBind patsyns
      ; let extra_binds = [ (NonRecursive, builder) | builder <-
 patsyn_builders ]
      ; return (extra_binds, thing) }
 }}}

 At the time we call `tcPatSynBuilderBind`, all the typechecked pattern
 synonyms are available in the global environment, so we could look up
 whatever we could possibly need from the output of the typechecker.
 Currently, it is only easy to grab stuff from the `PatSyn` (which
 deliberately doesn't contain any details of the actual definition of the
 pattern synonym, only its type), but we should be able to look up the
 `PatSynBind Id Id` for a given `PatSynBind Name Name`; and then we should
 be in business.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9867#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list