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/dependent | |
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/dependent')
4 files changed, 6 insertions, 6 deletions
diff --git a/testsuite/tests/dependent/should_fail/T11471.stderr b/testsuite/tests/dependent/should_fail/T11471.stderr index c0292270cc..377d1da759 100644 --- a/testsuite/tests/dependent/should_fail/T11471.stderr +++ b/testsuite/tests/dependent/should_fail/T11471.stderr @@ -3,7 +3,7 @@ T11471.hs:15:10: error: [GHC-18872] • Couldn't match a lifted type with an unlifted type When matching types a :: * - Int# :: TYPE 'IntRep + Int# :: TYPE IntRep Expected: Proxy a Actual: Proxy Int# • In the first argument of ‘f’, namely ‘(undefined :: Proxy Int#)’ diff --git a/testsuite/tests/dependent/should_fail/T13135_simple.stderr b/testsuite/tests/dependent/should_fail/T13135_simple.stderr index 68f5dd3e30..0a3a4d578a 100644 --- a/testsuite/tests/dependent/should_fail/T13135_simple.stderr +++ b/testsuite/tests/dependent/should_fail/T13135_simple.stderr @@ -2,7 +2,7 @@ T13135_simple.hs:34:11: error: [GHC-83865] • Couldn't match type ‘SmartFun sig’ with ‘Bool’ Expected: Int -> Bool - Actual: SmartFun ('SigFun Int sig) + Actual: SmartFun (SigFun Int sig) The type variable ‘sig’ is ambiguous • In the expression: smartSym In an equation for ‘problem’: problem = smartSym diff --git a/testsuite/tests/dependent/should_fail/T17131.stderr b/testsuite/tests/dependent/should_fail/T17131.stderr index 3bc040f45b..e1bea915eb 100644 --- a/testsuite/tests/dependent/should_fail/T17131.stderr +++ b/testsuite/tests/dependent/should_fail/T17131.stderr @@ -2,8 +2,8 @@ T17131.hs:12:34: error: [GHC-83865] • Couldn't match kind: TypeReps xs with: '[LiftedRep] - Expected kind ‘TYPE ('TupleRep (TypeReps xs))’, - but ‘(# a #)’ has kind ‘TYPE ('TupleRep '[LiftedRep])’ + Expected kind ‘TYPE (TupleRep (TypeReps xs))’, + but ‘(# a #)’ has kind ‘TYPE (TupleRep '[LiftedRep])’ The type variable ‘xs’ is ambiguous • In the type ‘(# a #)’ In the type family declaration for ‘Tuple#’ diff --git a/testsuite/tests/dependent/should_fail/T17541.stderr b/testsuite/tests/dependent/should_fail/T17541.stderr index ed30993549..b37cf260b3 100644 --- a/testsuite/tests/dependent/should_fail/T17541.stderr +++ b/testsuite/tests/dependent/should_fail/T17541.stderr @@ -1,7 +1,7 @@ T17541.hs:19:17: error: [GHC-83865] - • Couldn't match kind ‘Rep rep’ with ‘'IntRep’ - Expected kind ‘TYPE (Rep rep)’, but ‘Int#’ has kind ‘TYPE 'IntRep’ + • Couldn't match kind ‘Rep rep’ with ‘IntRep’ + Expected kind ‘TYPE (Rep rep)’, but ‘Int#’ has kind ‘TYPE IntRep’ The type variable ‘rep’ is ambiguous • In the type ‘Int#’ In the type family declaration for ‘Unboxed’ |