[GHC] #11044: Parse error on empty multi-line deprecation warnings

GHC ghc-devs at haskell.org
Sun Nov 1 12:40:01 UTC 2015


#11044: Parse error on empty multi-line deprecation warnings
-------------------------------------+-------------------------------------
           Reporter:  inaki          |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.2
  (Parser)                           |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  GHC rejects
  Unknown/Multiple                   |  valid program
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Bug #3303 introduced support for multi-line deprecation messages, with
 syntax
 {{{
 {-# DEPRECATED someFunction ["One line", "another line"] #-}
 }}}

 The following gives a parse error, though:
 {{{
 {-# DEPRECATED someFunction [] #-}
 }}}

 I think that it would be reasonable to treat this case as
 {{{
 {-# DEPRECATED somefunction "" #-}
 }}}

 For motivation: we ran into this problem when writing bindings to external
 libraries. The API description for the original library includes
 deprecation info, with the deprecation messages sometimes spanning
 multiple lines, so it was convenient to use the list syntax above when
 generating the Haskell wrappers. But the parse error forced us to special
 case the case of no deprecation message. We can easily do this, of course,
 but perhaps the restriction to non-empty lists was not intentional?

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


More information about the ghc-tickets mailing list