diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 6b0317bd9c9b0f8b285e29f8531e7d1840576446..d038562a733e2c742d7618b4a57b393b26b84df6 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -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 } diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index 2da5fc00a968dc27767a1aa3a9d456bf714aa9e9..98b45744ce774d3b771f5458a01243dd22ba05f5 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -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 diff --git a/testsuite/tests/ghc-api/annotations/T15303.stdout b/testsuite/tests/ghc-api/annotations/T15303.stdout new file mode 100644 index 0000000000000000000000000000000000000000..003dab5761219f6e236a90845bfbeaa3b85d2798 --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/T15303.stdout @@ -0,0 +1,35 @@ +---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]) +] diff --git a/testsuite/tests/ghc-api/annotations/Test15303.hs b/testsuite/tests/ghc-api/annotations/Test15303.hs new file mode 100644 index 0000000000000000000000000000000000000000..212e9da5accb76e554a49af1ea646e455ccb8a4e --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/Test15303.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TypeOperators #-} + +(~#) :: Comonad w => CascadeW w (t ': ts) -> w t -> Last (t ': ts) +(~#) = cascadeW +infixr 0 ~# diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index adc0d14370e8115b7ad8c200666c2c6e8da1efea..666cb3f044a5864165d6e73a65587424599a5a36 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -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'])