summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2022-11-18 12:53:00 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-25 04:39:04 -0500
commit13d627bbd0bc3dd30d672de341aa7f471be0aa2c (patch)
tree3464a8c6dca4b9bb47db356352d964279eca94fe /testsuite/tests/polykinds
parent1f1b99b86ab2b005604aea08b0614279a8ad1244 (diff)
downloadhaskell-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/polykinds')
-rw-r--r--testsuite/tests/polykinds/T12444.stderr8
-rw-r--r--testsuite/tests/polykinds/T7230.stderr6
-rw-r--r--testsuite/tests/polykinds/T8566.stderr13
3 files changed, 13 insertions, 14 deletions
diff --git a/testsuite/tests/polykinds/T12444.stderr b/testsuite/tests/polykinds/T12444.stderr
index e6403aa82b..80b77efcb3 100644
--- a/testsuite/tests/polykinds/T12444.stderr
+++ b/testsuite/tests/polykinds/T12444.stderr
@@ -1,16 +1,16 @@
T12444.hs:19:11: error: [GHC-25897]
- • Couldn't match type ‘b’ with ‘'Succ (c :+: b)’
- Expected: SNat ('Succ (c :+: b))
+ • Couldn't match type ‘b’ with ‘Succ (c :+: b)’
+ Expected: SNat (Succ (c :+: b))
Actual: SNat b
‘b’ is a rigid type variable bound by
the type signature for:
foo :: forall (c :: Nat) (b :: Nat).
- SNat ('Succ c) -> SNat b -> SNat ('Succ (c :+: b))
+ SNat (Succ c) -> SNat b -> SNat (Succ (c :+: b))
at T12444.hs:18:1-55
• In the expression: x
In an equation for ‘foo’: foo _ x = x
• Relevant bindings include
x :: SNat b (bound at T12444.hs:19:7)
- foo :: SNat ('Succ c) -> SNat b -> SNat ('Succ (c :+: b))
+ foo :: SNat (Succ c) -> SNat b -> SNat (Succ (c :+: b))
(bound at T12444.hs:19:1)
diff --git a/testsuite/tests/polykinds/T7230.stderr b/testsuite/tests/polykinds/T7230.stderr
index 696a4f0d1c..a18aaeda3b 100644
--- a/testsuite/tests/polykinds/T7230.stderr
+++ b/testsuite/tests/polykinds/T7230.stderr
@@ -1,10 +1,10 @@
T7230.hs:48:32: error: [GHC-05617]
- • Could not deduce ‘(x :<<= x1) ~ 'True’
- from the context: Increasing xs ~ 'True
+ • Could not deduce ‘(x :<<= x1) ~ True’
+ from the context: Increasing xs ~ True
bound by the type signature for:
crash :: forall (xs :: [Nat]).
- (Increasing xs ~ 'True) =>
+ (Increasing xs ~ True) =>
SList xs -> SBool (Increasing xs)
at T7230.hs:47:1-68
or from: xs ~ (x : xs1)
diff --git a/testsuite/tests/polykinds/T8566.stderr b/testsuite/tests/polykinds/T8566.stderr
index a5df878b27..478359f2c1 100644
--- a/testsuite/tests/polykinds/T8566.stderr
+++ b/testsuite/tests/polykinds/T8566.stderr
@@ -1,19 +1,18 @@
T8566.hs:35:9: error: [GHC-39999]
- • Could not deduce ‘C ('AA (t (I a ps)) as) ps fs0’
+ • Could not deduce ‘C (AA (t (I a ps)) as) ps fs0’
arising from a use of ‘c’
- from the context: C ('AA (t (I a ps)) as) ps fs
+ from the context: C (AA (t (I a ps)) as) ps fs
bound by the instance declaration at T8566.hs:33:10-67
- or from: 'AA t (a : as) ~ 'AA t1 as1
+ or from: AA t (a : as) ~ AA t1 as1
bound by a pattern with constructor:
- A :: forall {v} (t :: v) (as :: [U (*)]) (r :: [*]).
- I ('AA t as) r,
+ A :: forall {v} (t :: v) (as :: [U (*)]) (r :: [*]). I (AA t as) r,
in an equation for ‘c’
at T8566.hs:35:5
The type variable ‘fs0’ is ambiguous
Relevant bindings include
- c :: I ('AA t (a : as)) ps -> I ('AA t (a : as)) ps
+ c :: I (AA t (a : as)) ps -> I (AA t (a : as)) ps
(bound at T8566.hs:35:3)
• In the expression: c undefined
In an equation for ‘c’: c A = c undefined
- In the instance declaration for ‘C ('AA t (a : as)) ps fs’
+ In the instance declaration for ‘C (AA t (a : as)) ps fs’