diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 62d1114ae42245269bc530c083f7d83eb90d595c..d72f50d8719822c0b0c909f1dba2bd1f18bc117d 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -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 diff --git a/testsuite/tests/parser/should_compile/T3303.hs b/testsuite/tests/parser/should_compile/T3303.hs index 08de52e6cdd28ff6d7ec7309f41a774d6c3dbca5..7d9bfbd6409fff2a6552f16729244818bf1ea5de 100644 --- a/testsuite/tests/parser/should_compile/T3303.hs +++ b/testsuite/tests/parser/should_compile/T3303.hs @@ -6,3 +6,5 @@ import T3303A bar :: Int bar = foo +bar2 :: Int +bar2 = foo2 diff --git a/testsuite/tests/parser/should_compile/T3303.stderr b/testsuite/tests/parser/should_compile/T3303.stderr index df227f47ef9a139b491e7d526a7e605252c20e15..a8d2f631cf402017259ede3298171e54f4a8fe27 100644 --- a/testsuite/tests/parser/should_compile/T3303.stderr +++ b/testsuite/tests/parser/should_compile/T3303.stderr @@ -1,6 +1,9 @@ -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: "" diff --git a/testsuite/tests/parser/should_compile/T3303A.hs b/testsuite/tests/parser/should_compile/T3303A.hs index daa4bfb91d503d5a4b77e62ddeea5b396cd73d12..07a2eb850372ea2e71f0892d99f5c4cdd9d3a36d 100644 --- a/testsuite/tests/parser/should_compile/T3303A.hs +++ b/testsuite/tests/parser/should_compile/T3303A.hs @@ -8,3 +8,8 @@ module T3303A where foo :: Int foo = 4 +-- Empty list should work too (#11044). +{-# DEPRECATED foo2 [] #-} + +foo2 :: Int +foo2 = 4