diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2022-11-18 12:53:00 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-11-25 04:39:04 -0500 |
commit | 13d627bbd0bc3dd30d672de341aa7f471be0aa2c (patch) | |
tree | 3464a8c6dca4b9bb47db356352d964279eca94fe /testsuite/tests/ghci/scripts/T7939.stdout | |
parent | 1f1b99b86ab2b005604aea08b0614279a8ad1244 (diff) | |
download | haskell-13d627bbd0bc3dd30d672de341aa7f471be0aa2c.tar.gz |
Print unticked promoted data constructors (#20531)
Before this patch, GHC unconditionally printed ticks before promoted
data constructors:
ghci> type T = True -- unticked (user-written)
ghci> :kind! T
T :: Bool
= 'True -- ticked (compiler output)
After this patch, GHC prints ticks only when necessary:
ghci> type F = False -- unticked (user-written)
ghci> :kind! F
F :: Bool
= False -- unticked (compiler output)
ghci> data False -- introduce ambiguity
ghci> :kind! F
F :: Bool
= 'False -- ticked by necessity (compiler output)
The old behavior can be enabled by -fprint-redundant-promotion-ticks.
Summary of changes:
* Rename PrintUnqualified to NamePprCtx
* Add QueryPromotionTick to it
* Consult the GlobalRdrEnv to decide whether to print a tick (see mkPromTick)
* Introduce -fprint-redundant-promotion-ticks
Co-authored-by: Artyom Kuznetsov <hi@wzrd.ht>
Diffstat (limited to 'testsuite/tests/ghci/scripts/T7939.stdout')
-rw-r--r-- | testsuite/tests/ghci/scripts/T7939.stdout | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/ghci/scripts/T7939.stdout b/testsuite/tests/ghci/scripts/T7939.stdout index 0d9e4d363c..6f0ab38948 100644 --- a/testsuite/tests/ghci/scripts/T7939.stdout +++ b/testsuite/tests/ghci/scripts/T7939.stdout @@ -16,18 +16,18 @@ type family G a where G :: * -> * type H :: Bool -> Bool type family H a where - H 'False = 'True + H False = True -- Defined at T7939.hs:15:1 H :: Bool -> Bool type J :: forall {k}. [k] -> Bool type family J a where - J '[] = 'False - forall k (h :: k) (t :: [k]). J (h : t) = 'True + J '[] = False + forall k (h :: k) (t :: [k]). J (h : t) = True -- Defined at T7939.hs:18:1 J :: [k] -> Bool type K :: forall {a}. [a] -> Maybe a type family K a1 where - K '[] = 'Nothing - forall a (h :: a) (t :: [a]). K (h : t) = 'Just h + K '[] = Nothing + forall a (h :: a) (t :: [a]). K (h : t) = Just h -- Defined at T7939.hs:22:1 K :: [a] -> Maybe a |