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 | |
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')
-rw-r--r-- | testsuite/tests/ghci/T18060/T18060.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/T18262/T18262.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/GhciKinds.stdout | 4 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T20974.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T6018ghcifail.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T7627.stdout | 8 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T7939.stdout | 10 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T8357.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T8535.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T8917.stdout | 4 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T9181.stdout | 9 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci020.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/should_run/T10145.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/should_run/T18562.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/should_run/T18594.stdout | 2 |
15 files changed, 29 insertions, 30 deletions
diff --git a/testsuite/tests/ghci/T18060/T18060.stdout b/testsuite/tests/ghci/T18060/T18060.stdout index f6a4ebb43d..f322bcb12c 100644 --- a/testsuite/tests/ghci/T18060/T18060.stdout +++ b/testsuite/tests/ghci/T18060/T18060.stdout @@ -1,5 +1,5 @@ type (->) :: * -> * -> * -type (->) = FUN 'Many :: * -> * -> * +type (->) = FUN Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/T18262/T18262.stdout b/testsuite/tests/ghci/T18262/T18262.stdout index 13868ead5a..dae6eebc4e 100644 --- a/testsuite/tests/ghci/T18262/T18262.stdout +++ b/testsuite/tests/ghci/T18262/T18262.stdout @@ -1 +1 @@ -instance [safe] Err 'B -- Defined at T18262.hs:11:10 +instance [safe] Err B -- Defined at T18262.hs:11:10 diff --git a/testsuite/tests/ghci/scripts/GhciKinds.stdout b/testsuite/tests/ghci/scripts/GhciKinds.stdout index b00c8650e6..6217619c9e 100644 --- a/testsuite/tests/ghci/scripts/GhciKinds.stdout +++ b/testsuite/tests/ghci/scripts/GhciKinds.stdout @@ -13,5 +13,5 @@ $(unboxedTupleT 2) :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE - ('TupleRep - ((':) @RuntimeRep k0 ((':) @RuntimeRep k1 ('[] @RuntimeRep)))) + (TupleRep + ((:) @RuntimeRep k0 ((:) @RuntimeRep k1 ('[] @RuntimeRep)))) diff --git a/testsuite/tests/ghci/scripts/T20974.stdout b/testsuite/tests/ghci/scripts/T20974.stdout index 6cfee4e9a4..0918e83959 100644 --- a/testsuite/tests/ghci/scripts/T20974.stdout +++ b/testsuite/tests/ghci/scripts/T20974.stdout @@ -1 +1 @@ -test :: F '[Monad, A, B] m => m () +test :: F [Monad, A, B] m => m () diff --git a/testsuite/tests/ghci/scripts/T6018ghcifail.stderr b/testsuite/tests/ghci/scripts/T6018ghcifail.stderr index af3d7480eb..36398cc89a 100644 --- a/testsuite/tests/ghci/scripts/T6018ghcifail.stderr +++ b/testsuite/tests/ghci/scripts/T6018ghcifail.stderr @@ -19,8 +19,8 @@ <interactive>:34:15: error: [GHC-05175] Type family equation violates the family's injectivity annotation. RHS of injective type family equation is a bare type variable - but these LHS type and kind patterns are not bare variables: ‘'Z’ - P 'Z m = m -- Defined at <interactive>:34:15 + but these LHS type and kind patterns are not bare variables: ‘Z’ + P Z m = m -- Defined at <interactive>:34:15 <interactive>:40:15: error: [GHC-05175] Type family equation violates the family's injectivity annotation. @@ -32,7 +32,7 @@ Type family equation violates the family's injectivity annotation. Type variable ‘n’ cannot be inferred from the right-hand side. In the type family equation: - K ('S n) m = 'S m -- Defined at <interactive>:44:15 + K (S n) m = S m -- Defined at <interactive>:44:15 <interactive>:49:15: error: [GHC-05175] Type family equation violates the family's injectivity annotation. diff --git a/testsuite/tests/ghci/scripts/T7627.stdout b/testsuite/tests/ghci/scripts/T7627.stdout index d819079041..ba4640d01b 100644 --- a/testsuite/tests/ghci/scripts/T7627.stdout +++ b/testsuite/tests/ghci/scripts/T7627.stdout @@ -27,17 +27,17 @@ instance (Semigroup a, Semigroup b) => Semigroup (a, b) instance Foldable ((,) a) -- Defined in ‘Data.Foldable’ instance (Bounded a, Bounded b) => Bounded (a, b) -- Defined in ‘GHC.Enum’ +instance (Eq a, Eq b) => Eq (a, b) -- Defined in ‘GHC.Classes’ +instance (Ord a, Ord b) => Ord (a, b) -- Defined in ‘GHC.Classes’ instance (Read a, Read b) => Read (a, b) -- Defined in ‘GHC.Read’ +instance (Show a, Show b) => Show (a, b) -- Defined in ‘GHC.Show’ instance Monoid a => Applicative ((,) a) -- Defined in ‘GHC.Base’ instance Functor ((,) a) -- Defined in ‘GHC.Base’ instance Monoid a => Monad ((,) a) -- Defined in ‘GHC.Base’ -instance (Eq a, Eq b) => Eq (a, b) -- Defined in ‘GHC.Classes’ -instance (Ord a, Ord b) => Ord (a, b) -- Defined in ‘GHC.Classes’ -instance (Show a, Show b) => Show (a, b) -- Defined in ‘GHC.Show’ type (#,#) :: * -> * -> TYPE - ('GHC.Types.TupleRep '[GHC.Types.LiftedRep, GHC.Types.LiftedRep]) + (GHC.Types.TupleRep [GHC.Types.LiftedRep, GHC.Types.LiftedRep]) data (#,#) a b = (#,#) a b -- Defined in ‘GHC.Prim’ (,) :: a -> b -> (a, b) 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 diff --git a/testsuite/tests/ghci/scripts/T8357.stdout b/testsuite/tests/ghci/scripts/T8357.stdout index 2f2cf22b47..d4ff79c366 100644 --- a/testsuite/tests/ghci/scripts/T8357.stdout +++ b/testsuite/tests/ghci/scripts/T8357.stdout @@ -1,3 +1,3 @@ foo :: Rec '["foo" ::: String] bar :: Rec '["bar" ::: String] -both :: Rec '["foo" ::: [Char], "bar" ::: String] +both :: Rec ["foo" ::: [Char], "bar" ::: String] diff --git a/testsuite/tests/ghci/scripts/T8535.stdout b/testsuite/tests/ghci/scripts/T8535.stdout index c6625fbcb8..a1b640f911 100644 --- a/testsuite/tests/ghci/scripts/T8535.stdout +++ b/testsuite/tests/ghci/scripts/T8535.stdout @@ -1,5 +1,5 @@ type (->) :: * -> * -> * -type (->) = FUN 'Many :: * -> * -> * +type (->) = FUN Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/scripts/T8917.stdout b/testsuite/tests/ghci/scripts/T8917.stdout index 8426b6ab10..1656fd7173 100644 --- a/testsuite/tests/ghci/scripts/T8917.stdout +++ b/testsuite/tests/ghci/scripts/T8917.stdout @@ -1,4 +1,4 @@ Zero + Succ Zero :: Nat -= 'Succ 'Zero += Succ Zero Succ (Zero + Zero) :: Nat -= 'Succ 'Zero += Succ Zero diff --git a/testsuite/tests/ghci/scripts/T9181.stdout b/testsuite/tests/ghci/scripts/T9181.stdout index f213526d8d..356d047a81 100644 --- a/testsuite/tests/ghci/scripts/T9181.stdout +++ b/testsuite/tests/ghci/scripts/T9181.stdout @@ -99,8 +99,7 @@ type (Data.Type.Ord.<=) x y = :: Constraint type (Data.Type.Ord.<=?) :: forall k. k -> k -> Bool type (Data.Type.Ord.<=?) m n = - Data.Type.Ord.OrdCond - (Data.Type.Ord.Compare m n) 'True 'True 'False + Data.Type.Ord.OrdCond (Data.Type.Ord.Compare m n) True True False :: Bool type GHC.TypeLits.Internal.CmpChar :: Char -> Char -> Ordering type family GHC.TypeLits.Internal.CmpChar a b @@ -143,13 +142,13 @@ type role Data.Type.Ord.OrderingI nominal nominal type Data.Type.Ord.OrderingI :: forall {k}. k -> k -> * data Data.Type.Ord.OrderingI a b where Data.Type.Ord.LTI :: forall {k} (a :: k) (b :: k). - (Data.Type.Ord.Compare a b ~ 'LT) => + (Data.Type.Ord.Compare a b ~ LT) => Data.Type.Ord.OrderingI a b Data.Type.Ord.EQI :: forall {k} (a :: k). - (Data.Type.Ord.Compare a a ~ 'EQ) => + (Data.Type.Ord.Compare a a ~ EQ) => Data.Type.Ord.OrderingI a a Data.Type.Ord.GTI :: forall {k} (a :: k) (b :: k). - (Data.Type.Ord.Compare a b ~ 'GT) => + (Data.Type.Ord.Compare a b ~ GT) => Data.Type.Ord.OrderingI a b pattern GHC.TypeNats.SNat :: () => GHC.TypeNats.KnownNat n => GHC.TypeNats.SNat n diff --git a/testsuite/tests/ghci/scripts/ghci020.stdout b/testsuite/tests/ghci/scripts/ghci020.stdout index c6625fbcb8..a1b640f911 100644 --- a/testsuite/tests/ghci/scripts/ghci020.stdout +++ b/testsuite/tests/ghci/scripts/ghci020.stdout @@ -1,5 +1,5 @@ type (->) :: * -> * -> * -type (->) = FUN 'Many :: * -> * -> * +type (->) = FUN Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/should_run/T10145.stdout b/testsuite/tests/ghci/should_run/T10145.stdout index c6625fbcb8..a1b640f911 100644 --- a/testsuite/tests/ghci/should_run/T10145.stdout +++ b/testsuite/tests/ghci/should_run/T10145.stdout @@ -1,5 +1,5 @@ type (->) :: * -> * -> * -type (->) = FUN 'Many :: * -> * -> * +type (->) = FUN Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/should_run/T18562.stdout b/testsuite/tests/ghci/should_run/T18562.stdout index 0f1937e33b..e569440a0d 100644 --- a/testsuite/tests/ghci/should_run/T18562.stdout +++ b/testsuite/tests/ghci/should_run/T18562.stdout @@ -1,3 +1,3 @@ CmpSymbol "a" "\0" :: Ordering -= 'GT += GT GT diff --git a/testsuite/tests/ghci/should_run/T18594.stdout b/testsuite/tests/ghci/should_run/T18594.stdout index 216186a632..4dbca53593 100644 --- a/testsuite/tests/ghci/should_run/T18594.stdout +++ b/testsuite/tests/ghci/should_run/T18594.stdout @@ -1,5 +1,5 @@ type (->) :: * -> * -> * -type (->) = FUN 'Many :: * -> * -> * +type (->) = FUN Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ |