Commit 8262c954 authored by thomie's avatar thomie Committed by Ben Gamari

Parser: allow empty multi-line deprecation warnings

This should work,

    {-# DEPRECATED someFunction [] #-}

Test Plan: parser/should_compile/T3303

Reviewers: bgamari, austin

Reviewed By: austin

Subscribers: mpickering

Differential Revision: https://phabricator.haskell.org/D1433

GHC Trac Issues: #11044
parent d9c1450a
......@@ -1422,6 +1422,7 @@ stringlist :: { Located (OrdList (Located StringLiteral)) }
return (sLL $1 $> (unLoc $1 `snocOL`
(L (gl $3) (getStringLiteral $3)))) }
| STRING { sLL $1 $> (unitOL (L (gl $1) (getStringLiteral $1))) }
| {- empty -} { noLoc nilOL }
-----------------------------------------------------------------------------
-- Annotations
......
......@@ -6,3 +6,5 @@ import T3303A
bar :: Int
bar = foo
bar2 :: Int
bar2 = foo2
T3303.hs:7:7: Warning:
T3303.hs:7:7: warning:
In the use of ‘foo’ (imported from T3303A):
Deprecated: "This is a multi-line
deprecation message
for foo"
T3303.hs:10:8: warning:
In the use of ‘foo2’ (imported from T3303A): Deprecated: ""
......@@ -8,3 +8,8 @@ module T3303A where
foo :: Int
foo = 4
-- Empty list should work too (#11044).
{-# DEPRECATED foo2 [] #-}
foo2 :: Int
foo2 = 4
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment