From 04bb8736e1b0573ac45905a0f8c96bcb91564e2d Mon Sep 17 00:00:00 2001 From: Richard Eisenberg Date: Tue, 15 Aug 2017 18:04:32 -0400 Subject: Fix #13407 by suppressing invisibles better. Previously, the iface-invisible-suppresser assumed that all invisible things are up front. Not true! test case: ghci/scripts/T13407 --- compiler/iface/IfaceType.hs | 6 +++--- testsuite/tests/ghci/scripts/T13407.script | 4 ++++ testsuite/tests/ghci/scripts/T13407.stdout | 3 +++ testsuite/tests/ghci/scripts/all.T | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 testsuite/tests/ghci/scripts/T13407.script create mode 100644 testsuite/tests/ghci/scripts/T13407.stdout diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs index 1f3ee6df07..dcd3ad3f9d 100644 --- a/compiler/iface/IfaceType.hs +++ b/compiler/iface/IfaceType.hs @@ -325,9 +325,9 @@ suppressIfaceInvisibles dflags tys xs where suppress _ [] = [] suppress [] a = a - suppress (k:ks) a@(_:xs) - | isInvisibleTyConBinder k = suppress ks xs - | otherwise = a + suppress (k:ks) (x:xs) + | isInvisibleTyConBinder k = suppress ks xs + | otherwise = x : suppress ks xs stripIfaceInvisVars :: DynFlags -> [IfaceTyConBinder] -> [IfaceTyConBinder] stripIfaceInvisVars dflags tyvars diff --git a/testsuite/tests/ghci/scripts/T13407.script b/testsuite/tests/ghci/scripts/T13407.script new file mode 100644 index 0000000000..f77fd42afe --- /dev/null +++ b/testsuite/tests/ghci/scripts/T13407.script @@ -0,0 +1,4 @@ +:set -XTypeInType -XRankNTypes +import Data.Kind +data Foo :: (* -> *) -> (forall k. k -> *) +:info Foo diff --git a/testsuite/tests/ghci/scripts/T13407.stdout b/testsuite/tests/ghci/scripts/T13407.stdout new file mode 100644 index 0000000000..7607413d11 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T13407.stdout @@ -0,0 +1,3 @@ +type role Foo phantom phantom +data Foo (a :: * -> *) (c :: k) + -- Defined at :3:1 diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index d8ba10d62e..fd3744e190 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -257,3 +257,4 @@ test('GhciCurDir', normal, ghci_script, ['GhciCurDir.script']) test('T13591', expect_broken(13591), ghci_script, ['T13591.script']) test('T13699', normal, ghci_script, ['T13699.script']) test('T13988', normal, ghci_script, ['T13988.script']) +test('T13407', normal, ghci_script, ['T13407.script']) -- cgit v1.2.1