diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2021-11-06 13:03:25 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-07 12:55:05 -0500 |
commit | 3d7e3d911c3dbfc114b7af33ad4b28cd2af29bbc (patch) | |
tree | 0ab04e83c31204e44cf509b3fc06c7fe5235a64f /compiler/GHC/Iface | |
parent | 0d8a883e4b880453e044af3a69a96a648496926f (diff) | |
download | haskell-3d7e3d911c3dbfc114b7af33ad4b28cd2af29bbc.tar.gz |
Print the Type kind qualified when ambiguous (#20627)
The Type kind is printed unqualified:
ghci> :set -XNoStarIsType
ghci> :k (->)
(->) :: Type -> Type -> Type
This is the desired behavior unless the user has defined
their own Type:
ghci> data Type
Then we want to resolve the ambiguity by qualification:
ghci> :k (->)
(->) :: GHC.Types.Type -> GHC.Types.Type -> GHC.Types.Type
Diffstat (limited to 'compiler/GHC/Iface')
-rw-r--r-- | compiler/GHC/Iface/Type.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Iface/Type.hs b/compiler/GHC/Iface/Type.hs index 6251798a0a..c3ef8b9b65 100644 --- a/compiler/GHC/Iface/Type.hs +++ b/compiler/GHC/Iface/Type.hs @@ -80,6 +80,7 @@ import GHC.Core.TyCon hiding ( pprPromotionQuote ) import GHC.Core.Coercion.Axiom import GHC.Types.Var import GHC.Builtin.Names +import {-# SOURCE #-} GHC.Builtin.Types ( liftedTypeKindTyConName ) import GHC.Types.Name import GHC.Types.Basic import GHC.Utils.Binary @@ -1503,7 +1504,7 @@ pprTyTcApp ctxt_prec tc tys = ppr_kind_type :: PprPrec -> SDoc ppr_kind_type ctxt_prec = sdocOption sdocStarIsType $ \case - False -> text "Type" + False -> pprPrefixOcc liftedTypeKindTyConName True -> maybeParen ctxt_prec starPrec $ unicodeSyntax (char '★') (char '*') |