[GHC] #8258: GHC accepts `data Foo where` in H2010 mode

GHC ghc-devs at haskell.org
Tue Feb 13 22:49:52 UTC 2018


#8258: GHC accepts `data Foo where` in H2010 mode
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                Owner:  sighingnow
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:
       Component:  Compiler          |              Version:  7.0.4
  (Parser)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  GHC accepts       |            Test Case:  parser/T8258,
  invalid program                    |  parser/T8258NoGADTs
      Blocked By:                    |             Blocking:  11384
 Related Tickets:                    |  Differential Rev(s):  Phab:D4350
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"8936ab69d18669bab3ca4edf40458f88ae5903f0/ghc" 8936ab6/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="8936ab69d18669bab3ca4edf40458f88ae5903f0"
 Raise parse error for `data T where`.

 Empty GADTs data declarations can't be identified in type checker. This
 patch adds additional checks in parser and raise a parse error when
 encounter empty GADTs declarations but extension `GADTs` is not enabled.

 Only empty declarations are checked in parser to avoid affecting
 existing
 error messages related to missing GADTs extension.

 This patch should fix issue 8258.

 Signed-off-by: HE, Tao <sighingnow at gmail.com>

 Test Plan: make test TEST="T8258 T8258NoGADTs"

 Reviewers: bgamari, mpickering, alanz, RyanGlScott

 Reviewed By: bgamari, RyanGlScott

 Subscribers: adamse, RyanGlScott, rwbarton, thomie, mpickering, carter

 GHC Trac Issues: #8258

 Differential Revision: https://phabricator.haskell.org/D4350
 }}}

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


More information about the ghc-tickets mailing list