[GHC] #11987: Allow record wildcards with pattern synonyms which are defined in GHCi

GHC ghc-devs at haskell.org
Sat Sep 24 19:51:28 UTC 2016


#11987: Allow record wildcards with pattern synonyms which are defined in GHCi
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  mpickering
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2544
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 The patch fixes comment:4 but doesn't fix the case where a user defines a
 record pattern synonym in the GHCi prompt.

 To be specific, here is the exact example which still fails.

 {{{
 *Test Prelude> pattern P{x} = Just x
 *Test Prelude> let x=5 in P{..}

 <interactive>:8:12: error:
     Illegal `..' notation for constructor ā€˜Pā€™
       The constructor has no labelled fields
 }}}

 It seems that `tcg_field_env` is not updated properly somewhere with the
 record pattern synonym selectors.

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


More information about the ghc-tickets mailing list