summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T20590.stderr
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2021-10-31 19:29:11 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-02 01:38:53 -0400
commita7e1be3d84d2b7d0515f909175cdfa5dcf0dc55c (patch)
tree5bc4f66b615c1eaf26bfbad6f08b8f7cc1adcfc1 /testsuite/tests/th/T20590.stderr
parentda1a8e2986731b767f5c977cb873034e771d9371 (diff)
downloadhaskell-a7e1be3d84d2b7d0515f909175cdfa5dcf0dc55c.tar.gz
Fix #20590 with another application of mkHsContextMaybe
We were always converting empty GADT contexts to `Just []` in `GHC.ThToHs`, which caused the pretty-printer to always print them as `() => ...`. This is easily fixed by using the `mkHsContextMaybe` function when converting GADT contexts so that empty contexts are turned to `Nothing`. This is in the same tradition established in commit 4c87a3d1d14f9e28c8aa0f6062e9c4201f469ad7. In the process of fixing this, I discovered that the `Cxt` argument to `mkHsContextMaybe` is completely unnecessary, as we can just as well check if the `LHsContext GhcPs` argument is empty. Fixes #20590.
Diffstat (limited to 'testsuite/tests/th/T20590.stderr')
-rw-r--r--testsuite/tests/th/T20590.stderr4
1 files changed, 4 insertions, 0 deletions
diff --git a/testsuite/tests/th/T20590.stderr b/testsuite/tests/th/T20590.stderr
new file mode 100644
index 0000000000..9d06f592a5
--- /dev/null
+++ b/testsuite/tests/th/T20590.stderr
@@ -0,0 +1,4 @@
+T20590.hs:(6,2)-(8,7): Splicing declarations
+ [d| data T where MkT :: forall a. a -> T |]
+ ======>
+ data T where MkT :: forall a. a -> T