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/patsyn | |
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/patsyn')
-rw-r--r-- | testsuite/tests/patsyn/should_fail/T15695.stderr | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/testsuite/tests/patsyn/should_fail/T15695.stderr b/testsuite/tests/patsyn/should_fail/T15695.stderr index 6753d8bb9c..f7f065b024 100644 --- a/testsuite/tests/patsyn/should_fail/T15695.stderr +++ b/testsuite/tests/patsyn/should_fail/T15695.stderr @@ -1,27 +1,27 @@ T15695.hs:40:14: warning: [GHC-25897] [-Wdeferred-type-errors (in -Wdefault)] - • Could not deduce ‘a2 ~ NA 'VO’ + • Could not deduce ‘a2 ~ NA VO’ from the context: ((* -> * -> *) ~ (k -> k1 -> *), Either ~~ f, - ctx ~~ (a2 ':&: (a3 ':&: 'E)), f a2 ~~ f1, f1 a3 ~~ a4) + ctx ~~ (a2 :&: (a3 :&: E)), f a2 ~~ f1, f1 a3 ~~ a4) bound by a pattern with pattern synonym: ASSO :: forall kind (a :: kind) (b :: Ctx kind). () => forall ks k (f :: k -> ks) (a1 :: k) ks1 k1 (f1 :: k1 -> ks1) (a2 :: k1) a3. - (kind ~ (k -> k1 -> *), a ~~ f, b ~~ (a1 ':&: (a2 ':&: 'E)), + (kind ~ (k -> k1 -> *), a ~~ f, b ~~ (a1 :&: (a2 :&: E)), f a1 ~~ f1, f1 a2 ~~ a3) => a3 -> ApplyT kind a b, in an equation for ‘from'’ at T15695.hs:40:8-21 Expected: a4 - Actual: Either (NA 'VO) a3 + Actual: Either (NA VO) a3 ‘a2’ is a rigid type variable bound by a pattern with pattern synonym: ASSO :: forall kind (a :: kind) (b :: Ctx kind). () => forall ks k (f :: k -> ks) (a1 :: k) ks1 k1 (f1 :: k1 -> ks1) (a2 :: k1) a3. - (kind ~ (k -> k1 -> *), a ~~ f, b ~~ (a1 ':&: (a2 ':&: 'E)), + (kind ~ (k -> k1 -> *), a ~~ f, b ~~ (a1 :&: (a2 :&: E)), f a1 ~~ f1, f1 a2 ~~ a3) => a3 -> ApplyT kind a b, in an equation for ‘from'’ @@ -30,7 +30,7 @@ T15695.hs:40:14: warning: [GHC-25897] [-Wdeferred-type-errors (in -Wdefault)] In the pattern: ASSO (Left a) In an equation for ‘from'’: from' (ASSO (Left a)) = Here (a :* Nil) • Relevant bindings include - from' :: ApplyT (* -> * -> *) Either ctx -> NS (NP NA) '[ '[ 'VO]] + from' :: ApplyT (* -> * -> *) Either ctx -> NS (NP NA) '[ '[VO]] (bound at T15695.hs:40:1) T15695.hs:41:33: warning: [GHC-83865] [-Wdeferred-type-errors (in -Wdefault)] @@ -43,5 +43,5 @@ T15695.hs:41:33: warning: [GHC-83865] [-Wdeferred-type-errors (in -Wdefault)] In an equation for ‘from'’: from' (ASSO (Right b)) = There (Here undefined) • Relevant bindings include - from' :: ApplyT (* -> * -> *) Either ctx -> NS (NP NA) '[ '[ 'VO]] + from' :: ApplyT (* -> * -> *) Either ctx -> NS (NP NA) '[ '[VO]] (bound at T15695.hs:40:1) |