diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-04-25 18:38:34 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-25 18:39:51 -0400 |
commit | da792e47981f65b2dba4fc76ce51dc3fb9c4c02d (patch) | |
tree | b962d875d058c6db652dfc681debcb0a9dcd7b80 /testsuite/tests/ghci | |
parent | 71c3cea60c74054b6ba9ed918a58814aa91e01c2 (diff) | |
download | haskell-da792e47981f65b2dba4fc76ce51dc3fb9c4c02d.tar.gz |
Only pretty-print binders in closed type families with -fprint-explicit-foralls
Previously, we were unconditionally pretty-printing all type variable
binders when pretty-printing closed type families (e.g., in the output
of `:info` in GHCi). This threw me for a loop, so let's guard this behind
the `-fprint-explicit-foralls` flag.
Test Plan: make test TEST=T13420
Reviewers: goldfire, austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13420
Differential Revision: https://phabricator.haskell.org/D3497
Diffstat (limited to 'testsuite/tests/ghci')
-rw-r--r-- | testsuite/tests/ghci/scripts/T13420.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T13420.script | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T13420.stdout | 6 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T7939.stdout | 8 | ||||
-rwxr-xr-x | testsuite/tests/ghci/scripts/all.T | 1 |
5 files changed, 20 insertions, 4 deletions
diff --git a/testsuite/tests/ghci/scripts/T13420.hs b/testsuite/tests/ghci/scripts/T13420.hs new file mode 100644 index 0000000000..6b84e65cb2 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T13420.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TypeFamilies #-} +module T13420 where + +type family F a where + F [Int] = Bool + F [a] = Double + F (a b) = Char diff --git a/testsuite/tests/ghci/scripts/T13420.script b/testsuite/tests/ghci/scripts/T13420.script new file mode 100644 index 0000000000..aba31bf7c2 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T13420.script @@ -0,0 +1,2 @@ +:load T13420 +:i F diff --git a/testsuite/tests/ghci/scripts/T13420.stdout b/testsuite/tests/ghci/scripts/T13420.stdout new file mode 100644 index 0000000000..e6b81adc41 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T13420.stdout @@ -0,0 +1,6 @@ +type family F a :: * + where + F [Int] = Bool + F [a] = Double + F (a b) = Char + -- Defined at T13420.hs:4:1 diff --git a/testsuite/tests/ghci/scripts/T7939.stdout b/testsuite/tests/ghci/scripts/T7939.stdout index 2b2c8b73ad..db2590c930 100644 --- a/testsuite/tests/ghci/scripts/T7939.stdout +++ b/testsuite/tests/ghci/scripts/T7939.stdout @@ -15,13 +15,13 @@ type family H (a :: Bool) :: Bool H :: Bool -> Bool type family J (a :: [k]) :: Bool where - [k] J k '[] = 'False - [k, (h :: k), (t :: [k])] J k (h : t) = 'True + J k '[] = 'False + J k (h : t) = 'True -- Defined at T7939.hs:17:1 J :: [k] -> Bool type family K (a1 :: [a]) :: Maybe a where - [a] K a '[] = 'Nothing - [a, (h :: a), (t :: [a])] K a (h : t) = 'Just h + K a '[] = 'Nothing + K a (h : t) = 'Just h -- Defined at T7939.hs:21:1 K :: [a] -> Maybe a diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 917537b9e7..ae0a5283f9 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -251,6 +251,7 @@ test('T12550', normal, ghci_script, ['T12550.script']) test('StaticPtr', normal, ghci_script, ['StaticPtr.script']) test('T13202', normal, ghci_script, ['T13202.script']) test('T13202a', normal, ghci_script, ['T13202a.script']) +test('T13420', normal, ghci_script, ['T13420.script']) test('T13466', normal, ghci_script, ['T13466.script']) test('GhciCurDir', normal, ghci_script, ['GhciCurDir.script']) test('T13591', expect_broken(13591), ghci_script, ['T13591.script']) |