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

GHC ghc-devs at haskell.org
Wed Sep 9 21:41:13 UTC 2015


#8258: GHC accepts `data Foo where` in H2010 mode
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  low               |               Milestone:  7.12.1
       Component:  Compiler          |                 Version:  7.0.4
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by siddhanathan):

 Should a trailing `where` be considered legal?

 For example, the following is valid:

 {{{
 c = 5 where

 a = 5 where b = 5
 }}}

 And the code above will be parsed as:

 {{{
 ==================== Parser ====================
 c = 5
 a = 5
   where
       b = 5
 }}}

 But the trailing `where` after `c = 5` was probably accidental.

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


More information about the ghc-tickets mailing list