Skip to content

Parse error on empty multi-line deprecation warnings

Bug #3303 (closed) 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?

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information