summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2016-11-08 21:37:48 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2016-12-07 21:31:13 +0200
commit499e43824bda967546ebf95ee33ec1f84a114a7c (patch)
tree58b313d734cfba014395ea5876db48e8400296a8 /testsuite/tests/partial-sigs
parent83d69dca896c7df1f2a36268d5b45c9283985ebf (diff)
downloadhaskell-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/partial-sigs')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T12845.stderr2
2 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
index fc12b71b6b..ea974895e2 100644
--- a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
@@ -3,7 +3,7 @@
SplicesUsed.hs:7:16: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘Maybe Bool’
- • In the type signature: maybeBool :: _
+ • In the type signature: maybeBool :: (_)
SplicesUsed.hs:8:15: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_a’ standing for ‘w’
@@ -37,21 +37,21 @@ SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
Where: ‘a’ is a rigid type variable bound by
the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
at SplicesUsed.hs:14:1-16
- • In the type signature: filter' :: _ -> _ -> _
+ • In the type signature: filter' :: (_ -> _ -> _)
SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘[a]’
Where: ‘a’ is a rigid type variable bound by
the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
at SplicesUsed.hs:14:1-16
- • In the type signature: filter' :: _ -> _ -> _
+ • In the type signature: filter' :: (_ -> _ -> _)
SplicesUsed.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘[a]’
Where: ‘a’ is a rigid type variable bound by
the inferred type of filter' :: (a -> Bool) -> [a] -> [a]
at SplicesUsed.hs:14:1-16
- • In the type signature: filter' :: _ -> _ -> _
+ • In the type signature: filter' :: (_ -> _ -> _)
SplicesUsed.hs:16:3: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘Eq a’
diff --git a/testsuite/tests/partial-sigs/should_compile/T12845.stderr b/testsuite/tests/partial-sigs/should_compile/T12845.stderr
index 0d19b1a6ed..b9d7d60a97 100644
--- a/testsuite/tests/partial-sigs/should_compile/T12845.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T12845.stderr
@@ -3,5 +3,5 @@ T12845.hs:18:70: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘() :: Constraint’
• In the type signature:
broken :: forall r r' rngs.
- ('(r, r') ~ Head rngs, Bar r r' ~ True, _) =>
+ ('(r, r') ~ Head rngs, Bar r r' ~ 'True, _) =>
Foo r -> Proxy rngs -> ()