[GHC] #13921: LANGUAGE pragma is accepted in module body

GHC ghc-devs at haskell.org
Tue Jul 4 20:06:09 UTC 2017


#13921: LANGUAGE pragma is accepted in module body
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
  (Parser)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by svenpanne):

 I would even go a step further: Syntactically, pragmas are just comments
 with a special content, so the example in the OP **must** be accepted from
 a language lawyer POV. It is equivalent (modulo column numbers) to:


 {{{#!haskell
 module Hi where

 h = 0
 }}}

 From a developer POV, a warning would be nice, though. :-)

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


More information about the ghc-tickets mailing list