diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2016-11-08 21:37:48 +0200 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2016-12-07 21:31:13 +0200 |
commit | 499e43824bda967546ebf95ee33ec1f84a114a7c (patch) | |
tree | 58b313d734cfba014395ea5876db48e8400296a8 /testsuite/tests/polykinds | |
parent | 83d69dca896c7df1f2a36268d5b45c9283985ebf (diff) | |
download | haskell-499e43824bda967546ebf95ee33ec1f84a114a7c.tar.gz |
Add HsSyn prettyprinter tests
Summary:
Add prettyprinter tests, which take a file, parse it, pretty print it,
re-parse the pretty printed version and then compare the original and
new ASTs (ignoring locations)
Updates haddock submodule to match the AST changes.
There are three issues outstanding
1. Extra parens around a context are not reproduced. This will require an
AST change and will be done in a separate patch.
2. Currently if an `HsTickPragma` is found, this is not pretty-printed,
to prevent noise in the output.
I am not sure what the desired behaviour in this case is, so have left
it as before. Test Ppr047 is marked as expected fail for this.
3. Apart from in a context, the ParsedSource AST keeps all the parens from
the original source. Something is happening in the renamer to remove the
parens around visible type application, causing T12530 to fail, as the
dumped splice decl is after the renamer.
This needs to be fixed by keeping the parens, but I do not know where they
are being removed. I have amended the test to pass, by removing the parens
in the expected output.
Test Plan: ./validate
Reviewers: goldfire, mpickering, simonpj, bgamari, austin
Reviewed By: simonpj, bgamari
Subscribers: simonpj, goldfire, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2752
GHC Trac Issues: #3384
Diffstat (limited to 'testsuite/tests/polykinds')
-rw-r--r-- | testsuite/tests/polykinds/PolyKinds04.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/PolyKinds07.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T10503.stderr | 3 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T11399.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T11520.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T11611.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T5716.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T5716a.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T6054.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T7151.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T7328.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T7433.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T7805.stderr | 2 |
13 files changed, 17 insertions, 16 deletions
diff --git a/testsuite/tests/polykinds/PolyKinds04.stderr b/testsuite/tests/polykinds/PolyKinds04.stderr index 8162dd247b..2a88291623 100644 --- a/testsuite/tests/polykinds/PolyKinds04.stderr +++ b/testsuite/tests/polykinds/PolyKinds04.stderr @@ -3,5 +3,5 @@ PolyKinds04.hs:5:16: Expecting one more argument to ‘Maybe’ Expected a type, but ‘Maybe’ has kind ‘* -> *’ In the first argument of ‘A’, namely ‘Maybe’ - In the type ‘A Maybe’ + In the type ‘(A Maybe)’ In the definition of data constructor ‘B1’ diff --git a/testsuite/tests/polykinds/PolyKinds07.stderr b/testsuite/tests/polykinds/PolyKinds07.stderr index 3a38a6777f..ce70e7d07a 100644 --- a/testsuite/tests/polykinds/PolyKinds07.stderr +++ b/testsuite/tests/polykinds/PolyKinds07.stderr @@ -2,6 +2,6 @@ PolyKinds07.hs:10:11: Data constructor ‘A1’ cannot be used here (it is defined and used in the same recursive group) - In the first argument of ‘B’, namely ‘A1’ - In the type ‘B A1’ + In the first argument of ‘B’, namely ‘ 'A1’ + In the type ‘B 'A1’ In the definition of data constructor ‘B1’ diff --git a/testsuite/tests/polykinds/T10503.stderr b/testsuite/tests/polykinds/T10503.stderr index 43cd62fd5f..ac8972dec6 100644 --- a/testsuite/tests/polykinds/T10503.stderr +++ b/testsuite/tests/polykinds/T10503.stderr @@ -13,4 +13,5 @@ T10503.hs:8:6: error: To defer the ambiguity check to use sites, enable AllowAmbiguousTypes In the type signature: h :: forall r. - (Proxy (KProxy :: KProxy k) ~ Proxy (KProxy :: KProxy *) => r) -> r + (Proxy ( 'KProxy :: KProxy k) ~ Proxy ( 'KProxy :: KProxy *) => r) + -> r diff --git a/testsuite/tests/polykinds/T11399.stderr b/testsuite/tests/polykinds/T11399.stderr index 48af87efc4..cd78c24792 100644 --- a/testsuite/tests/polykinds/T11399.stderr +++ b/testsuite/tests/polykinds/T11399.stderr @@ -5,5 +5,5 @@ T11399.hs:10:32: error: a :: * -> * TYPE :: GHC.Types.RuntimeRep -> * Expected kind ‘* -> *’, but ‘UhOh a’ has kind ‘a * -> *’ - • In the first argument of ‘Functor’, namely ‘UhOh a’ + • In the first argument of ‘Functor’, namely ‘(UhOh a)’ In the instance declaration for ‘Functor (UhOh a)’ diff --git a/testsuite/tests/polykinds/T11520.stderr b/testsuite/tests/polykinds/T11520.stderr index f598d85551..11a81baf62 100644 --- a/testsuite/tests/polykinds/T11520.stderr +++ b/testsuite/tests/polykinds/T11520.stderr @@ -2,5 +2,5 @@ T11520.hs:15:77: error: • Expected kind ‘k20 -> k10’, but ‘g’ has kind ‘k’ • In the second argument of ‘Compose’, namely ‘g’ - In the first argument of ‘Typeable’, namely ‘Compose f g’ + In the first argument of ‘Typeable’, namely ‘(Compose f g)’ In the instance declaration for ‘Typeable (Compose f g)’ diff --git a/testsuite/tests/polykinds/T11611.stderr b/testsuite/tests/polykinds/T11611.stderr index 15d4749393..6c723786b0 100644 --- a/testsuite/tests/polykinds/T11611.stderr +++ b/testsuite/tests/polykinds/T11611.stderr @@ -2,5 +2,5 @@ T11611.hs:8:37: error: • Expected kind ‘[*]’, but ‘a’ has kind ‘*’ • In the first argument of ‘A’, namely ‘a’ - In the first argument of ‘Show’, namely ‘A a’ + In the first argument of ‘Show’, namely ‘(A a)’ In the stand-alone deriving instance for ‘Show a => Show (A a)’ diff --git a/testsuite/tests/polykinds/T5716.stderr b/testsuite/tests/polykinds/T5716.stderr index 8bc8883daf..d85166b0bb 100644 --- a/testsuite/tests/polykinds/T5716.stderr +++ b/testsuite/tests/polykinds/T5716.stderr @@ -2,6 +2,6 @@ T5716.hs:13:33: error: Data constructor ‘U1’ cannot be used here (Perhaps you intended to use TypeInType) - In the first argument of ‘I’, namely ‘U1 DFInt’ + In the first argument of ‘I’, namely ‘(U1 DFInt)’ In the type ‘I (U1 DFInt)’ In the definition of data constructor ‘I1’ diff --git a/testsuite/tests/polykinds/T5716a.stderr b/testsuite/tests/polykinds/T5716a.stderr index 5cee2edc2e..acec5e146d 100644 --- a/testsuite/tests/polykinds/T5716a.stderr +++ b/testsuite/tests/polykinds/T5716a.stderr @@ -2,6 +2,6 @@ T5716a.hs:10:27: Data constructor ‘Bar’ cannot be used here (it comes from a data family instance) - In the type ‘Bar a’ + In the type ‘(Bar a)’ In the definition of data constructor ‘Bar’ In the data instance declaration for ‘DF’ diff --git a/testsuite/tests/polykinds/T6054.stderr b/testsuite/tests/polykinds/T6054.stderr index c8b39b06ad..800b5599ce 100644 --- a/testsuite/tests/polykinds/T6054.stderr +++ b/testsuite/tests/polykinds/T6054.stderr @@ -3,7 +3,7 @@ T6054.hs:7:14: error: • No instance for (Bar '() a0) arising from an expression type signature • In the first argument of ‘print’, namely - ‘(Proxy :: Bar () a => Proxy a)’ - In the expression: print (Proxy :: Bar () a => Proxy a) + ‘(Proxy :: Bar '() a => Proxy a)’ + In the expression: print (Proxy :: Bar '() a => Proxy a) In an equation for ‘foo’: - foo = print (Proxy :: Bar () a => Proxy a) + foo = print (Proxy :: Bar '() a => Proxy a) diff --git a/testsuite/tests/polykinds/T7151.stderr b/testsuite/tests/polykinds/T7151.stderr index 00fed221c1..8b9ff9040e 100644 --- a/testsuite/tests/polykinds/T7151.stderr +++ b/testsuite/tests/polykinds/T7151.stderr @@ -1,4 +1,4 @@ T7151.hs:3:12: - Illegal type: ‘'[Int, String]’ + Illegal type: ‘[Int, String]’ Perhaps you intended to use DataKinds diff --git a/testsuite/tests/polykinds/T7328.stderr b/testsuite/tests/polykinds/T7328.stderr index 95b3a7782f..76f81555dd 100644 --- a/testsuite/tests/polykinds/T7328.stderr +++ b/testsuite/tests/polykinds/T7328.stderr @@ -2,5 +2,5 @@ T7328.hs:8:34: error: • Occurs check: cannot construct the infinite kind: k1 ~ k0 -> k1 • In the first argument of ‘Foo’, namely ‘f’ - In the first argument of ‘Proxy’, namely ‘Foo f’ + In the first argument of ‘Proxy’, namely ‘(Foo f)’ In the type signature: foo :: a ~ f i => Proxy (Foo f) diff --git a/testsuite/tests/polykinds/T7433.stderr b/testsuite/tests/polykinds/T7433.stderr index d3f57a9ee7..1cd2ad2f29 100644 --- a/testsuite/tests/polykinds/T7433.stderr +++ b/testsuite/tests/polykinds/T7433.stderr @@ -2,5 +2,5 @@ T7433.hs:2:10: Data constructor ‘Z’ cannot be used here (Perhaps you intended to use DataKinds) - In the type ‘Z’ + In the type ‘ 'Z’ In the type declaration for ‘T’ diff --git a/testsuite/tests/polykinds/T7805.stderr b/testsuite/tests/polykinds/T7805.stderr index 33b9d4df6b..9ca48645be 100644 --- a/testsuite/tests/polykinds/T7805.stderr +++ b/testsuite/tests/polykinds/T7805.stderr @@ -2,5 +2,5 @@ T7805.hs:7:21: error: Expected kind ‘forall a. a -> a’, but ‘x’ has kind ‘k0’ In the first argument of ‘HR’, namely ‘x’ - In the first argument of ‘F’, namely ‘HR x’ + In the first argument of ‘F’, namely ‘(HR x)’ In the type instance declaration for ‘F’ |