diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-02-03 04:48:18 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-02-09 16:22:17 -0500 |
commit | be4231782b316754109d339a409ffc05767e883f (patch) | |
tree | 1b0296e2879af43edd85a69564a5079c3fb33e9e | |
parent | 891a791f3f2438e5d768e1f96119d275e58e8d37 (diff) | |
download | haskell-be4231782b316754109d339a409ffc05767e883f.tar.gz |
Fix pretty-printing of invisible arguments for FUN 'Many (#19310)
-rw-r--r-- | compiler/GHC/Iface/Type.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T19310.script | 4 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T19310.stdout | 3 | ||||
-rwxr-xr-x | testsuite/tests/ghci/scripts/all.T | 1 |
4 files changed, 12 insertions, 2 deletions
diff --git a/compiler/GHC/Iface/Type.hs b/compiler/GHC/Iface/Type.hs index 4cb9178f98..67f27410e8 100644 --- a/compiler/GHC/Iface/Type.hs +++ b/compiler/GHC/Iface/Type.hs @@ -1419,8 +1419,10 @@ pprTyTcApp ctxt_prec tc tys = , IA_Arg (IfaceTyConApp rep IA_Nil) Required args <- tys , rep `ifaceTyConHasKey` manyDataConKey , print_type_abbreviations -- See Note [Printing type abbreviations] - -> pprIfacePrefixApp ctxt_prec (parens arrow) (map (ppr_ty appPrec) $ - appArgsIfaceTypes $ stripInvisArgs (PrintExplicitKinds print_kinds) args) + -> pprIfacePrefixApp ctxt_prec (parens arrow) (map (ppr_app_arg appPrec) $ + appArgsIfaceTypesArgFlags $ stripInvisArgs (PrintExplicitKinds print_kinds) args) + -- Use appArgsIfaceTypesArgFlags to print invisible arguments + -- correctly (#19310) | tc `ifaceTyConHasKey` errorMessageTypeErrorFamKey , not debug diff --git a/testsuite/tests/ghci/scripts/T19310.script b/testsuite/tests/ghci/scripts/T19310.script new file mode 100644 index 0000000000..64a72c2e50 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T19310.script @@ -0,0 +1,4 @@ +:m GHC.Exts GHC.Types +:set -fprint-explicit-kinds -XDataKinds -XKindSignatures +type T = FUN 'Many :: Type -> Type -> Type +:i T diff --git a/testsuite/tests/ghci/scripts/T19310.stdout b/testsuite/tests/ghci/scripts/T19310.stdout new file mode 100644 index 0000000000..4e7ad631fc --- /dev/null +++ b/testsuite/tests/ghci/scripts/T19310.stdout @@ -0,0 +1,3 @@ +type T :: * -> * -> * +type T = (->) @{'LiftedRep} @{'LiftedRep} :: * -> * -> * + -- Defined at <interactive>:3:1 diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index a85fe27fd3..13b2b73b6c 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -329,4 +329,5 @@ test('T18828', normal, ghci_script, ['T18828.script']) test('T19197', normal, ghci_script, ['T19197.script']) test('T19158', normal, ghci_script, ['T19158.script']) test('T19279', normal, ghci_script, ['T19279.script']) +test('T19310', normal, ghci_script, ['T19310.script']) |