Commit e53c113d authored by Alan Zimmerman's avatar Alan Zimmerman

API Annotations when parsing typapp

Make sure the original annotations are still accessible for a promoted
type.

Closes #15303
parent 1c2c2d3d
......@@ -1930,9 +1930,9 @@ tyapp :: { Located TyEl }
| qtyconop { sL1 $1 $ TyElOpr (unLoc $1) }
| tyvarop { sL1 $1 $ TyElOpr (unLoc $1) }
| SIMPLEQUOTE qconop {% ams (sLL $1 $> $ TyElOpr (unLoc $2))
[mj AnnSimpleQuote $1] }
[mj AnnSimpleQuote $1,mj AnnVal $2] }
| SIMPLEQUOTE varop {% ams (sLL $1 $> $ TyElOpr (unLoc $2))
[mj AnnSimpleQuote $1] }
[mj AnnSimpleQuote $1,mj AnnVal $2] }
atype_docs :: { LHsType GhcPs }
: atype docprev { sLL $1 $> $ HsDocTy noExt $1 $2 }
......
......@@ -141,3 +141,7 @@ T12417:
.PHONY: T13163
T13163:
$(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test13163.hs
.PHONY: T15303
T15303:
$(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test15303.hs
---Problems (should be empty list)---
[]
---Annotations-----------------------
-- SrcSpan the annotation is attached to, AnnKeywordId,
-- list of locations the keyword item appears in
[
((Test15303.hs:4:1-4,AnnCloseP), [Test15303.hs:4:4]),
((Test15303.hs:4:1-4,AnnOpenP), [Test15303.hs:4:1]),
((Test15303.hs:4:1-4,AnnVal), [Test15303.hs:4:2-3]),
((Test15303.hs:4:1-66,AnnDcolon), [Test15303.hs:4:6-7]),
((Test15303.hs:4:1-66,AnnSemi), [Test15303.hs:5:1]),
((Test15303.hs:4:9-17,AnnDarrow), [Test15303.hs:4:19-20]),
((Test15303.hs:4:22-41,AnnRarrow), [Test15303.hs:4:43-44]),
((Test15303.hs:4:22-66,AnnRarrow), [Test15303.hs:4:43-44]),
((Test15303.hs:4:33-41,AnnCloseP), [Test15303.hs:4:41]),
((Test15303.hs:4:33-41,AnnOpenP), [Test15303.hs:4:33]),
((Test15303.hs:4:36-37,AnnSimpleQuote), [Test15303.hs:4:36]),
((Test15303.hs:4:36-37,AnnVal), [Test15303.hs:4:37]),
((Test15303.hs:4:46-48,AnnRarrow), [Test15303.hs:4:50-51]),
((Test15303.hs:4:46-66,AnnRarrow), [Test15303.hs:4:50-51]),
((Test15303.hs:4:58-66,AnnCloseP), [Test15303.hs:4:66]),
((Test15303.hs:4:58-66,AnnOpenP), [Test15303.hs:4:58]),
((Test15303.hs:4:61-62,AnnSimpleQuote), [Test15303.hs:4:61]),
((Test15303.hs:4:61-62,AnnVal), [Test15303.hs:4:62]),
((Test15303.hs:5:1-4,AnnCloseP), [Test15303.hs:5:4]),
((Test15303.hs:5:1-4,AnnOpenP), [Test15303.hs:5:1]),
((Test15303.hs:5:1-4,AnnVal), [Test15303.hs:5:2-3]),
((Test15303.hs:5:1-15,AnnEqual), [Test15303.hs:5:6]),
((Test15303.hs:5:1-15,AnnFunId), [Test15303.hs:5:1-4]),
((Test15303.hs:5:1-15,AnnSemi), [Test15303.hs:6:1]),
((Test15303.hs:6:1-11,AnnInfix), [Test15303.hs:6:1-6]),
((Test15303.hs:6:1-11,AnnSemi), [Test15303.hs:7:1]),
((Test15303.hs:6:1-11,AnnVal), [Test15303.hs:6:8]),
((<no location info>,AnnEofPos), [Test15303.hs:7:1])
]
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
(~#) :: Comonad w => CascadeW w (t ': ts) -> w t -> Last (t ': ts)
(~#) = cascadeW
infixr 0 ~#
......@@ -57,3 +57,5 @@ test('T12417', [extra_files(['Test12417.hs']),
ignore_stderr], run_command, ['$MAKE -s --no-print-directory T12417'])
test('T13163', [extra_files(['Test13163.hs']),
ignore_stderr], run_command, ['$MAKE -s --no-print-directory T13163'])
test('T15303', [extra_files(['Test15303.hs']),
ignore_stderr], run_command, ['$MAKE -s --no-print-directory T15303'])
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