summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/parser/should_compile/DumpParsedAst.hs13
-rw-r--r--testsuite/tests/parser/should_compile/DumpParsedAst.stderr329
-rw-r--r--testsuite/tests/parser/should_compile/all.T1
3 files changed, 343 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_compile/DumpParsedAst.hs b/testsuite/tests/parser/should_compile/DumpParsedAst.hs
new file mode 100644
index 0000000000..a0d65ad8d6
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/DumpParsedAst.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE DataKinds, PolyKinds, TypeOperators, TypeFamilies #-}
+
+module DumpParsedAst where
+
+data Peano = Zero | Succ Peano
+
+type family Length (as :: [k]) :: Peano where
+ Length (a : as) = Succ (Length as)
+ Length '[] = Zero
+
+type family Length' (as :: [k]) :: Peano where
+ Length' ((:) a as) = Succ (Length' as)
+ Length' '[] = Zero
diff --git a/testsuite/tests/parser/should_compile/DumpParsedAst.stderr b/testsuite/tests/parser/should_compile/DumpParsedAst.stderr
new file mode 100644
index 0000000000..9c08b3e7bd
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/DumpParsedAst.stderr
@@ -0,0 +1,329 @@
+
+==================== Parser AST ====================
+
+({ DumpParsedAst.hs:1:1 }
+ (HsModule
+ (Just
+ ({ DumpParsedAst.hs:3:8-20 }{ModuleName: DumpParsedAst}))
+ (Nothing)
+ []
+ [
+ ({ DumpParsedAst.hs:5:1-30 }
+ (TyClD
+ (DataDecl
+ ({ DumpParsedAst.hs:5:6-10 }
+ (Unqual {OccName: Peano}))
+ (HsQTvs
+ (PlaceHolder)
+ []
+ (PlaceHolder))
+ (Prefix)
+ (HsDataDefn
+ (DataType)
+ ({ <no location info> }
+ [])
+ (Nothing)
+ (Nothing)
+ [
+ ({ DumpParsedAst.hs:5:14-17 }
+ (ConDeclH98
+ ({ DumpParsedAst.hs:5:14-17 }
+ (Unqual {OccName: Zero}))
+ (Nothing)
+ (Just
+ ({ <no location info> }
+ []))
+ (PrefixCon
+ [])
+ (Nothing))),
+ ({ DumpParsedAst.hs:5:21-30 }
+ (ConDeclH98
+ ({ DumpParsedAst.hs:5:21-24 }
+ (Unqual {OccName: Succ}))
+ (Nothing)
+ (Just
+ ({ <no location info> }
+ []))
+ (PrefixCon
+ [
+ ({ DumpParsedAst.hs:5:26-30 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:5:26-30 }
+ (Unqual {OccName: Peano}))))])
+ (Nothing)))]
+ ({ <no location info> }
+ []))
+ (PlaceHolder)
+ (PlaceHolder)))),
+ ({ DumpParsedAst.hs:7:1-39 }
+ (TyClD
+ (FamDecl
+ (FamilyDecl
+ (ClosedTypeFamily
+ (Just
+ [
+ ({ DumpParsedAst.hs:8:3-36 }
+ (TyFamEqn
+ ({ DumpParsedAst.hs:8:3-8 }
+ (Unqual {OccName: Length}))
+ (HsIB
+ (PlaceHolder)
+ [
+ ({ DumpParsedAst.hs:8:10-17 }
+ (HsParTy
+ ({ DumpParsedAst.hs:8:11-16 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:8:11 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:8:11 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:8:11 }
+ (Unqual {OccName: a})))))),
+ ({ DumpParsedAst.hs:8:13 }
+ (HsAppInfix
+ ({ DumpParsedAst.hs:8:13 }
+ (Exact {Name: ghc-prim:GHC.Types.:{(w) d 66}})))),
+ ({ DumpParsedAst.hs:8:15-16 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:8:15-16 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:8:15-16 }
+ (Unqual {OccName: as}))))))]))))])
+ (Prefix)
+ ({ DumpParsedAst.hs:8:21-36 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:8:21-24 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:8:21-24 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:8:21-24 }
+ (Unqual {OccName: Succ})))))),
+ ({ DumpParsedAst.hs:8:26-36 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:8:26-36 }
+ (HsParTy
+ ({ DumpParsedAst.hs:8:27-35 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:8:27-32 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:8:27-32 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:8:27-32 }
+ (Unqual {OccName: Length})))))),
+ ({ DumpParsedAst.hs:8:34-35 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:8:34-35 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:8:34-35 }
+ (Unqual {OccName: as}))))))]))))))])))),
+ ({ DumpParsedAst.hs:9:3-24 }
+ (TyFamEqn
+ ({ DumpParsedAst.hs:9:3-8 }
+ (Unqual {OccName: Length}))
+ (HsIB
+ (PlaceHolder)
+ [
+ ({ DumpParsedAst.hs:9:10-12 }
+ (HsExplicitListTy
+ (Promoted)
+ (PlaceHolder)
+ []))])
+ (Prefix)
+ ({ DumpParsedAst.hs:9:21-24 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:9:21-24 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:9:21-24 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:9:21-24 }
+ (Unqual {OccName: Zero}))))))]))))]))
+ ({ DumpParsedAst.hs:7:13-18 }
+ (Unqual {OccName: Length}))
+ (HsQTvs
+ (PlaceHolder)
+ [
+ ({ DumpParsedAst.hs:7:20-30 }
+ (KindedTyVar
+ ({ DumpParsedAst.hs:7:21-22 }
+ (Unqual {OccName: as}))
+ ({ DumpParsedAst.hs:7:27-29 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:7:27-29 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:7:27-29 }
+ (HsListTy
+ ({ DumpParsedAst.hs:7:28 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:7:28 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:7:28 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:7:28 }
+ (Unqual {OccName: k}))))))]))))))]))))]
+ (PlaceHolder))
+ (Prefix)
+ ({ DumpParsedAst.hs:7:32-39 }
+ (KindSig
+ ({ DumpParsedAst.hs:7:35-39 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:7:35-39 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:7:35-39 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:7:35-39 }
+ (Unqual {OccName: Peano}))))))]))))
+ (Nothing))))),
+ ({ DumpParsedAst.hs:11:1-40 }
+ (TyClD
+ (FamDecl
+ (FamilyDecl
+ (ClosedTypeFamily
+ (Just
+ [
+ ({ DumpParsedAst.hs:12:3-40 }
+ (TyFamEqn
+ ({ DumpParsedAst.hs:12:3-9 }
+ (Unqual {OccName: Length'}))
+ (HsIB
+ (PlaceHolder)
+ [
+ ({ DumpParsedAst.hs:12:11-20 }
+ (HsParTy
+ ({ DumpParsedAst.hs:12:12-19 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:12:12-14 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:12:12-14 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:12:12-14 }
+ (Exact {Name: ghc-prim:GHC.Types.:{(w) d 66}})))))),
+ ({ DumpParsedAst.hs:12:16 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:12:16 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:12:16 }
+ (Unqual {OccName: a})))))),
+ ({ DumpParsedAst.hs:12:18-19 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:12:18-19 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:12:18-19 }
+ (Unqual {OccName: as}))))))]))))])
+ (Prefix)
+ ({ DumpParsedAst.hs:12:24-40 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:12:24-27 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:12:24-27 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:12:24-27 }
+ (Unqual {OccName: Succ})))))),
+ ({ DumpParsedAst.hs:12:29-40 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:12:29-40 }
+ (HsParTy
+ ({ DumpParsedAst.hs:12:30-39 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:12:30-36 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:12:30-36 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:12:30-36 }
+ (Unqual {OccName: Length'})))))),
+ ({ DumpParsedAst.hs:12:38-39 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:12:38-39 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:12:38-39 }
+ (Unqual {OccName: as}))))))]))))))])))),
+ ({ DumpParsedAst.hs:13:3-27 }
+ (TyFamEqn
+ ({ DumpParsedAst.hs:13:3-9 }
+ (Unqual {OccName: Length'}))
+ (HsIB
+ (PlaceHolder)
+ [
+ ({ DumpParsedAst.hs:13:11-13 }
+ (HsExplicitListTy
+ (Promoted)
+ (PlaceHolder)
+ []))])
+ (Prefix)
+ ({ DumpParsedAst.hs:13:24-27 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:13:24-27 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:13:24-27 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:13:24-27 }
+ (Unqual {OccName: Zero}))))))]))))]))
+ ({ DumpParsedAst.hs:11:13-19 }
+ (Unqual {OccName: Length'}))
+ (HsQTvs
+ (PlaceHolder)
+ [
+ ({ DumpParsedAst.hs:11:21-31 }
+ (KindedTyVar
+ ({ DumpParsedAst.hs:11:22-23 }
+ (Unqual {OccName: as}))
+ ({ DumpParsedAst.hs:11:28-30 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:11:28-30 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:11:28-30 }
+ (HsListTy
+ ({ DumpParsedAst.hs:11:29 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:11:29 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:11:29 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:11:29 }
+ (Unqual {OccName: k}))))))]))))))]))))]
+ (PlaceHolder))
+ (Prefix)
+ ({ DumpParsedAst.hs:11:33-40 }
+ (KindSig
+ ({ DumpParsedAst.hs:11:36-40 }
+ (HsAppsTy
+ [
+ ({ DumpParsedAst.hs:11:36-40 }
+ (HsAppPrefix
+ ({ DumpParsedAst.hs:11:36-40 }
+ (HsTyVar
+ (NotPromoted)
+ ({ DumpParsedAst.hs:11:36-40 }
+ (Unqual {OccName: Peano}))))))]))))
+ (Nothing)))))]
+ (Nothing)
+ (Nothing)))
diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T
index 24c562e555..22a952474e 100644
--- a/testsuite/tests/parser/should_compile/all.T
+++ b/testsuite/tests/parser/should_compile/all.T
@@ -105,3 +105,4 @@ test('VtaParse', normal, compile, [''])
test('T10196', normal, compile, [''])
test('T10379', normal, compile, [''])
test('T10582', expect_broken(10582), compile, [''])
+test('DumpParsedAst', normal, compile, ['-ddump-parsed-ast'])