summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-api
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2019-01-30 16:20:52 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-08 11:00:22 -0500
commitcbfc9fcaa33c3b341830962906543dfca1dfedd7 (patch)
tree919cbe496d074362c410a400f4d75703e306fcd3 /testsuite/tests/ghc-api
parentbe15f7457b98fa0378de7e8146c122757f03c4e9 (diff)
downloadhaskell-cbfc9fcaa33c3b341830962906543dfca1dfedd7.tar.gz
API Annotations: AnnAt disconnected for TYPEAPP
For the code type family F1 (a :: k) (f :: k -> Type) :: Type where F1 @Peano a f = T @Peano f a the API annotation for the first @ is not attached to a SourceSpan in the ParsedSource Closes #16236
Diffstat (limited to 'testsuite/tests/ghc-api')
-rw-r--r--testsuite/tests/ghc-api/annotations/Makefile4
-rw-r--r--testsuite/tests/ghc-api/annotations/T16236.stdout85
-rw-r--r--testsuite/tests/ghc-api/annotations/Test16236.hs20
-rw-r--r--testsuite/tests/ghc-api/annotations/all.T2
4 files changed, 111 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile
index f7a66f41bb..ef2b5eaafa 100644
--- a/testsuite/tests/ghc-api/annotations/Makefile
+++ b/testsuite/tests/ghc-api/annotations/Makefile
@@ -153,3 +153,7 @@ T16212:
.PHONY: T16230
T16230:
$(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test16230.hs
+
+.PHONY: T16236
+T16236:
+ $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test16236.hs
diff --git a/testsuite/tests/ghc-api/annotations/T16236.stdout b/testsuite/tests/ghc-api/annotations/T16236.stdout
new file mode 100644
index 0000000000..986b9a4ff2
--- /dev/null
+++ b/testsuite/tests/ghc-api/annotations/T16236.stdout
@@ -0,0 +1,85 @@
+---Unattached Annotation Problems (should be empty list)---
+[]
+---Ann before enclosing span problem (should be empty list)---
+[
+
+]
+
+---Annotations-----------------------
+-- SrcSpan the annotation is attached to, AnnKeywordId,
+-- list of locations the keyword item appears in
+[
+((Test16236.hs:1:1,AnnModule), [Test16236.hs:4:1-6]),
+((Test16236.hs:1:1,AnnWhere), [Test16236.hs:4:22-26]),
+((Test16236.hs:5:1-16,AnnImport), [Test16236.hs:5:1-6]),
+((Test16236.hs:5:1-16,AnnSemi), [Test16236.hs:7:1]),
+((Test16236.hs:7:1-30,AnnData), [Test16236.hs:7:1-4]),
+((Test16236.hs:7:1-30,AnnEqual), [Test16236.hs:7:12]),
+((Test16236.hs:7:1-30,AnnSemi), [Test16236.hs:9:1]),
+((Test16236.hs:7:14-17,AnnVbar), [Test16236.hs:7:19]),
+((Test16236.hs:9:1-39,AnnCloseP), [Test16236.hs:9:30]),
+((Test16236.hs:9:1-39,AnnDcolon), [Test16236.hs:9:32-33]),
+((Test16236.hs:9:1-39,AnnFamily), [Test16236.hs:9:6-11]),
+((Test16236.hs:9:1-39,AnnOpenP), [Test16236.hs:9:20]),
+((Test16236.hs:9:1-39,AnnSemi), [Test16236.hs:14:1]),
+((Test16236.hs:9:1-39,AnnType), [Test16236.hs:9:1-4]),
+((Test16236.hs:9:1-39,AnnWhere), [Test16236.hs:9:41-45]),
+((Test16236.hs:9:20-30,AnnCloseP), [Test16236.hs:9:30]),
+((Test16236.hs:9:20-30,AnnOpenP), [Test16236.hs:9:20]),
+((Test16236.hs:9:21-29,AnnDcolon), [Test16236.hs:9:24-25]),
+((Test16236.hs:9:27-29,AnnCloseS), [Test16236.hs:9:29]),
+((Test16236.hs:9:27-29,AnnOpenS), [Test16236.hs:9:27]),
+((Test16236.hs:10:3-36,AnnEqual), [Test16236.hs:10:19]),
+((Test16236.hs:10:3-36,AnnSemi), [Test16236.hs:11:3]),
+((Test16236.hs:10:10-17,AnnCloseP), [Test16236.hs:10:17]),
+((Test16236.hs:10:10-17,AnnOpenP), [Test16236.hs:10:10]),
+((Test16236.hs:10:26-36,AnnCloseP), [Test16236.hs:10:36]),
+((Test16236.hs:10:26-36,AnnOpenP), [Test16236.hs:10:26]),
+((Test16236.hs:11:3-24,AnnEqual), [Test16236.hs:11:19]),
+((Test16236.hs:11:10-12,AnnCloseS), [Test16236.hs:11:12]),
+((Test16236.hs:11:10-12,AnnOpenS), [Test16236.hs:11:11]),
+((Test16236.hs:11:10-12,AnnSimpleQuote), [Test16236.hs:11:10]),
+((Test16236.hs:14:1-29,AnnCloseP), [Test16236.hs:14:17]),
+((Test16236.hs:14:1-29,AnnData), [Test16236.hs:14:1-4]),
+((Test16236.hs:14:1-29,AnnEqual), [Test16236.hs:14:19]),
+((Test16236.hs:14:1-29,AnnOpenP), [Test16236.hs:14:10]),
+((Test16236.hs:14:1-29,AnnSemi), [Test16236.hs:16:1]),
+((Test16236.hs:14:10-17,AnnCloseP), [Test16236.hs:14:17]),
+((Test16236.hs:14:10-17,AnnOpenP), [Test16236.hs:14:10]),
+((Test16236.hs:14:11-16,AnnDcolon), [Test16236.hs:14:13-14]),
+((Test16236.hs:14:25-29,AnnCloseP), [Test16236.hs:14:29]),
+((Test16236.hs:14:25-29,AnnOpenP), [Test16236.hs:14:25]),
+((Test16236.hs:16:1-48,AnnCloseP), [Test16236.hs:16:23, Test16236.hs:16:40]),
+((Test16236.hs:16:1-48,AnnDcolon), [Test16236.hs:16:42-43]),
+((Test16236.hs:16:1-48,AnnFamily), [Test16236.hs:16:6-11]),
+((Test16236.hs:16:1-48,AnnOpenP), [Test16236.hs:16:16, Test16236.hs:16:25]),
+((Test16236.hs:16:1-48,AnnSemi), [Test16236.hs:19:1]),
+((Test16236.hs:16:1-48,AnnType), [Test16236.hs:16:1-4]),
+((Test16236.hs:16:1-48,AnnWhere), [Test16236.hs:16:50-54]),
+((Test16236.hs:16:16-23,AnnCloseP), [Test16236.hs:16:23]),
+((Test16236.hs:16:16-23,AnnOpenP), [Test16236.hs:16:16]),
+((Test16236.hs:16:17-22,AnnDcolon), [Test16236.hs:16:19-20]),
+((Test16236.hs:16:25-40,AnnCloseP), [Test16236.hs:16:40]),
+((Test16236.hs:16:25-40,AnnOpenP), [Test16236.hs:16:25]),
+((Test16236.hs:16:26-39,AnnDcolon), [Test16236.hs:16:28-29]),
+((Test16236.hs:16:31,AnnRarrow), [Test16236.hs:16:33-34]),
+((Test16236.hs:16:31-39,AnnRarrow), [Test16236.hs:16:33-34]),
+((Test16236.hs:17:3-30,AnnEqual), [Test16236.hs:17:17]),
+((Test16236.hs:19:1-11,AnnCloseP), [Test16236.hs:19:24]),
+((Test16236.hs:19:1-11,AnnData), [Test16236.hs:19:1-4]),
+((Test16236.hs:19:1-11,AnnFamily), [Test16236.hs:19:6-11]),
+((Test16236.hs:19:1-11,AnnOpenP), [Test16236.hs:19:17]),
+((Test16236.hs:19:1-11,AnnSemi), [Test16236.hs:20:1]),
+((Test16236.hs:19:17-24,AnnCloseP), [Test16236.hs:19:24]),
+((Test16236.hs:19:17-24,AnnOpenP), [Test16236.hs:19:17]),
+((Test16236.hs:19:18-23,AnnDcolon), [Test16236.hs:19:20-21]),
+((Test16236.hs:20:1-49,AnnData), [Test16236.hs:20:1-4]),
+((Test16236.hs:20:1-49,AnnEqual), [Test16236.hs:20:41]),
+((Test16236.hs:20:1-49,AnnInstance), [Test16236.hs:20:6-13]),
+((Test16236.hs:20:1-49,AnnSemi), [Test16236.hs:21:1]),
+((Test16236.hs:20:20-37,AnnCloseP), [Test16236.hs:20:37]),
+((Test16236.hs:20:20-37,AnnOpenP), [Test16236.hs:20:20]),
+((Test16236.hs:20:21-26,AnnRarrow), [Test16236.hs:20:28-29]),
+((Test16236.hs:20:21-36,AnnRarrow), [Test16236.hs:20:28-29]),
+((<no location info>,AnnEofPos), [Test16236.hs:21:1])
+]
diff --git a/testsuite/tests/ghc-api/annotations/Test16236.hs b/testsuite/tests/ghc-api/annotations/Test16236.hs
new file mode 100644
index 0000000000..e19a0ee0c1
--- /dev/null
+++ b/testsuite/tests/ghc-api/annotations/Test16236.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE DataKinds, PolyKinds, TypeOperators, TypeFamilies
+ , TypeApplications, TypeInType #-}
+
+module DumpParsedAst where
+import Data.Kind
+
+data Peano = Zero | Succ Peano
+
+type family Length (as :: [k]) :: Peano where
+ Length (a : as) = Succ (Length as)
+ Length '[] = Zero
+
+-- vis kind app
+data T f (a :: k) = MkT (f a)
+
+type family F1 (a :: k) (f :: k -> Type) :: Type where
+ F1 @Peano a f = T @Peano f a
+
+data family DF3 (a :: k)
+data instance DF3 @(K.Type -> K.Type) b = DF3Char
diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T
index e4413f7924..139c4412ed 100644
--- a/testsuite/tests/ghc-api/annotations/all.T
+++ b/testsuite/tests/ghc-api/annotations/all.T
@@ -63,3 +63,5 @@ test('T16212', [expect_broken(16212),extra_files(['Test16212.hs']),
ignore_stderr], makefile_test, ['T16212'])
test('T16230', [extra_files(['Test16230.hs']),
ignore_stderr], makefile_test, ['T16230'])
+test('T16236', [extra_files(['Test16236.hs']),
+ ignore_stderr], makefile_test, ['T16236'])