summaryrefslogtreecommitdiff
path: root/testsuite/tests/haddock
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-07-29 20:48:04 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-05 07:14:39 -0400
commit5d651c78fed7e55b3b3cd21a04499d1a2f75204d (patch)
treea60bb609ff4735e3f50ae179c906d5bba63bfc8e /testsuite/tests/haddock
parent1f8090933268b1ca071bc4a8a35b0f1828a76fce (diff)
downloadhaskell-5d651c78fed7e55b3b3cd21a04499d1a2f75204d.tar.gz
Minor fix to pretty-printing of linear types
The function ppr_arrow_chain was not printing multiplicities. Also remove the Outputable instance: no longer used, and could cover bugs like those.
Diffstat (limited to 'testsuite/tests/haddock')
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/all.T1
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs8
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr10
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/all.T b/testsuite/tests/haddock/should_compile_flag_haddock/all.T
index 5dc5df090c..850fd3ce5a 100644
--- a/testsuite/tests/haddock/should_compile_flag_haddock/all.T
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/all.T
@@ -63,3 +63,4 @@ test('haddockExtraDocs', normal, compile, ['-haddock -Winvalid-haddock'])
test('haddockTySyn', normal, compile, ['-haddock -Winvalid-haddock -ddump-parsed'])
test('T8944', normal, compile, ['-haddock -Winvalid-haddock -ddump-parsed'])
test('T17652', normal, compile, ['-haddock -Winvalid-haddock -ddump-parsed'])
+test('haddockLinear', normal, compile, ['-haddock -Winvalid-haddock -ddump-parsed'])
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs b/testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs
new file mode 100644
index 0000000000..76293500d7
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE LinearTypes #-}
+{-# LANGUAGE GADTs #-}
+module ShouldCompile where
+
+data T where
+ C1 :: Int %1 -> T
+ C2 :: Int %m -> T
+ C3 :: Int -> T
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr
new file mode 100644
index 0000000000..41fce03725
--- /dev/null
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr
@@ -0,0 +1,10 @@
+
+==================== Parser ====================
+module ShouldCompile where
+data T
+ where
+ C1 :: Int %1 -> T
+ C2 :: Int %m -> T
+ C3 :: Int -> T
+
+