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/rep-poly | |
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/rep-poly')
-rw-r--r-- | testsuite/tests/rep-poly/LevPolyLet.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/RepPolyRule3.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/RepPolySum.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/RepPolyUnboxedPatterns.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/RepPolyWrappedVar.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/T13929.stderr | 10 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/T17817.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/T20277.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/T20363b.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/T20423.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/T20423b.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/rep-poly/T20426.stderr | 2 |
12 files changed, 24 insertions, 24 deletions
diff --git a/testsuite/tests/rep-poly/LevPolyLet.stderr b/testsuite/tests/rep-poly/LevPolyLet.stderr index 95e606cf7e..fe56b3d840 100644 --- a/testsuite/tests/rep-poly/LevPolyLet.stderr +++ b/testsuite/tests/rep-poly/LevPolyLet.stderr @@ -2,6 +2,6 @@ LevPolyLet.hs:17:7: error: [GHC-55287] • The binder ‘x’ does not have a fixed runtime representation. Its type is: - a :: TYPE ('BoxedRep v) + a :: TYPE (BoxedRep v) • In the expression: let x = f 42 in undefined In an equation for ‘example’: example f = let x = f 42 in undefined diff --git a/testsuite/tests/rep-poly/RepPolyRule3.stderr b/testsuite/tests/rep-poly/RepPolyRule3.stderr index fb6b135b72..6752fa60e0 100644 --- a/testsuite/tests/rep-poly/RepPolyRule3.stderr +++ b/testsuite/tests/rep-poly/RepPolyRule3.stderr @@ -3,7 +3,7 @@ RepPolyRule3.hs:17:57: error: [GHC-55287] • The argument ‘x’ of ‘g’ does not have a fixed runtime representation. Its kind is: - TYPE (F 'WordRep) + TYPE (F WordRep) (Use -fprint-explicit-coercions to see the full type.) • In the expression: g x When checking the rewrite rule "g_id" @@ -12,7 +12,7 @@ RepPolyRule3.hs:23:52: error: [GHC-55287] • The argument ‘x’ of ‘h’ does not have a fixed runtime representation. Its kind is: - TYPE (F 'WordRep) + TYPE (F WordRep) (Use -fprint-explicit-coercions to see the full type.) • In the expression: h x When checking the rewrite rule "h_id" diff --git a/testsuite/tests/rep-poly/RepPolySum.stderr b/testsuite/tests/rep-poly/RepPolySum.stderr index 89a8ef85a9..88cb9978cc 100644 --- a/testsuite/tests/rep-poly/RepPolySum.stderr +++ b/testsuite/tests/rep-poly/RepPolySum.stderr @@ -2,7 +2,7 @@ RepPolySum.hs:11:9: error: [GHC-55287] • The unboxed sum does not have a fixed runtime representation. Its type is: - (# Int# | a #) :: TYPE ('SumRep '[ 'IntRep, rep]) + (# Int# | a #) :: TYPE (SumRep [IntRep, rep]) • In the expression: (# | bar () #) In an equation for ‘foo’: foo _ @@ -14,6 +14,6 @@ RepPolySum.hs:11:9: error: [GHC-55287] RepPolySum.hs:20:9: error: [GHC-55287] • The unboxed sum does not have a fixed runtime representation. Its type is: - (# Int# | a #) :: TYPE ('SumRep '[ 'IntRep, rep]) + (# Int# | a #) :: TYPE (SumRep [IntRep, rep]) • In the expression: (# 17# | #) In an equation for ‘baz’: baz _ = (# 17# | #) diff --git a/testsuite/tests/rep-poly/RepPolyUnboxedPatterns.stderr b/testsuite/tests/rep-poly/RepPolyUnboxedPatterns.stderr index a84d9d89f8..495a4fc1d8 100644 --- a/testsuite/tests/rep-poly/RepPolyUnboxedPatterns.stderr +++ b/testsuite/tests/rep-poly/RepPolyUnboxedPatterns.stderr @@ -3,10 +3,10 @@ RepPolyUnboxedPatterns.hs:8:1: error: [GHC-55287] The first pattern in the equation for ‘foo’ does not have a fixed runtime representation. Its type is: - (# a, b #) :: TYPE ('TupleRep '[rep1, rep2]) + (# a, b #) :: TYPE (TupleRep [rep1, rep2]) RepPolyUnboxedPatterns.hs:11:1: error: [GHC-55287] The first pattern in the equations for ‘bar’ does not have a fixed runtime representation. Its type is: - (# a | b #) :: TYPE ('SumRep '[rep1, rep2]) + (# a | b #) :: TYPE (SumRep [rep1, rep2]) diff --git a/testsuite/tests/rep-poly/RepPolyWrappedVar.stderr b/testsuite/tests/rep-poly/RepPolyWrappedVar.stderr index abdafcf070..bdfc215389 100644 --- a/testsuite/tests/rep-poly/RepPolyWrappedVar.stderr +++ b/testsuite/tests/rep-poly/RepPolyWrappedVar.stderr @@ -4,6 +4,6 @@ RepPolyWrappedVar.hs:15:10: error: [GHC-55287] The first argument of ‘mkWeak#’ does not have a fixed runtime representation. Its type is: - a :: TYPE ('BoxedRep l) + a :: TYPE (BoxedRep l) • In the expression: mkWeak# @a @Int @Bool In an equation for ‘primop’: primop = mkWeak# @a @Int @Bool diff --git a/testsuite/tests/rep-poly/T13929.stderr b/testsuite/tests/rep-poly/T13929.stderr index 5ad878794c..5c4a61b80d 100644 --- a/testsuite/tests/rep-poly/T13929.stderr +++ b/testsuite/tests/rep-poly/T13929.stderr @@ -10,20 +10,20 @@ T13929.hs:29:24: error: [GHC-55287] In an equation for ‘gunbox’: gunbox (x :*: y) = (# gunbox x, gunbox y #) In the instance declaration for - ‘GUnbox (f :*: g) ('TupleRep '[rf, rg])’ + ‘GUnbox (f :*: g) (TupleRep [rf, rg])’ • Relevant bindings include x :: f p (bound at T13929.hs:29:13) - gunbox :: (:*:) f g p -> GUnboxed (f :*: g) ('TupleRep '[rf, rg]) + gunbox :: (:*:) f g p -> GUnboxed (f :*: g) (TupleRep [rf, rg]) (bound at T13929.hs:29:5) T13929.hs:34:21: error: [GHC-55287] • • The unboxed sum does not have a fixed runtime representation. Its type is: - GUnboxed (f :+: g) ('SumRep '[rf, rg]) :: TYPE ('SumRep '[rf, rg]) + GUnboxed (f :+: g) (SumRep [rf, rg]) :: TYPE (SumRep [rf, rg]) • The unboxed sum does not have a fixed runtime representation. Its type is: - GUnboxed (f :+: g) ('SumRep '[rf, rg]) :: TYPE ('SumRep '[rf, rg]) + GUnboxed (f :+: g) (SumRep [rf, rg]) :: TYPE (SumRep [rf, rg]) • In the expression: (# | gunbox r #) In an equation for ‘gunbox’: gunbox (R1 r) = (# | gunbox r #) In the instance declaration for - ‘GUnbox (f :+: g) ('SumRep '[rf, rg])’ + ‘GUnbox (f :+: g) (SumRep [rf, rg])’ diff --git a/testsuite/tests/rep-poly/T17817.stderr b/testsuite/tests/rep-poly/T17817.stderr index 4d3cb94343..4ce33c9a08 100644 --- a/testsuite/tests/rep-poly/T17817.stderr +++ b/testsuite/tests/rep-poly/T17817.stderr @@ -4,6 +4,6 @@ T17817.hs:16:10: error: [GHC-55287] The first argument of ‘mkWeak#’ does not have a fixed runtime representation. Its type is: - a :: TYPE ('BoxedRep l) + a :: TYPE (BoxedRep l) • In the expression: mkWeak# In an equation for ‘primop’: primop = mkWeak# diff --git a/testsuite/tests/rep-poly/T20277.stderr b/testsuite/tests/rep-poly/T20277.stderr index e55d2846f8..d6245ba381 100644 --- a/testsuite/tests/rep-poly/T20277.stderr +++ b/testsuite/tests/rep-poly/T20277.stderr @@ -2,6 +2,6 @@ T20277.hs:14:9: error: [GHC-55287] • The unboxed sum does not have a fixed runtime representation. Its type is: - (# Int# | a #) :: TYPE ('SumRep '[ 'IntRep, rep]) + (# Int# | a #) :: TYPE (SumRep [IntRep, rep]) • In the expression: (# 17# | #) In an equation for ‘baz’: baz _ = (# 17# | #) diff --git a/testsuite/tests/rep-poly/T20363b.stderr b/testsuite/tests/rep-poly/T20363b.stderr index e730bc62e0..a06cd16741 100644 --- a/testsuite/tests/rep-poly/T20363b.stderr +++ b/testsuite/tests/rep-poly/T20363b.stderr @@ -3,20 +3,20 @@ T20363b.hs:48:10: error: [GHC-55287] • • The newtype constructor pattern does not have a fixed runtime representation. Its type is: - NestedTuple ('Suc 'Zero) Addr# :: TYPE - (NestedTupleRep ('Suc 'Zero) 'AddrRep) + NestedTuple (Suc Zero) Addr# :: TYPE + (NestedTupleRep (Suc Zero) AddrRep) • The argument ‘(# nullAddr#, (##) #)’ of ‘MkNT’ does not have a fixed runtime representation. Its type is: - NestedTuple ('Suc 'Zero) Addr# :: TYPE - (NestedTupleRep ('Suc 'Zero) 'AddrRep) + NestedTuple (Suc Zero) Addr# :: TYPE + (NestedTupleRep (Suc Zero) AddrRep) • The newtype constructor pattern does not have a fixed runtime representation. Its type is: - NestedTuple 'Zero Addr# :: TYPE (NestedTupleRep 'Zero 'AddrRep) + NestedTuple Zero Addr# :: TYPE (NestedTupleRep Zero AddrRep) • The argument ‘(##)’ of ‘MkNT’ does not have a fixed runtime representation. Its type is: - NestedTuple 'Zero Addr# :: TYPE (NestedTupleRep 'Zero 'AddrRep) + NestedTuple Zero Addr# :: TYPE (NestedTupleRep Zero AddrRep) • In the pattern: MkNT (# i, (##) #) In an equation for ‘test2b’: test2b (MkNT (# i, (##) #)) = i diff --git a/testsuite/tests/rep-poly/T20423.stderr b/testsuite/tests/rep-poly/T20423.stderr index e9f7f7263e..c54142ccc1 100644 --- a/testsuite/tests/rep-poly/T20423.stderr +++ b/testsuite/tests/rep-poly/T20423.stderr @@ -1,4 +1,4 @@ T20423.hs:11:1: error: [GHC-18478] The pattern synonym scrutinee does not have a fixed runtime representation: - • LPInt lev :: TYPE ('BoxedRep lev) + • LPInt lev :: TYPE (BoxedRep lev) diff --git a/testsuite/tests/rep-poly/T20423b.stderr b/testsuite/tests/rep-poly/T20423b.stderr index e76697fcfe..ffecc14b63 100644 --- a/testsuite/tests/rep-poly/T20423b.stderr +++ b/testsuite/tests/rep-poly/T20423b.stderr @@ -1,4 +1,4 @@ T20423b.hs:17:1: error: [GHC-18478] The pattern synonym scrutinee does not have a fixed runtime representation: - • LPGADT l :: TYPE ('BoxedRep l) + • LPGADT l :: TYPE (BoxedRep l) diff --git a/testsuite/tests/rep-poly/T20426.stderr b/testsuite/tests/rep-poly/T20426.stderr index e1dfe0a5a8..a1757ba835 100644 --- a/testsuite/tests/rep-poly/T20426.stderr +++ b/testsuite/tests/rep-poly/T20426.stderr @@ -3,4 +3,4 @@ T20426.hs:15:1: error: [GHC-55287] The first pattern in the equations for ‘getInt#’ does not have a fixed runtime representation. Its type is: - LPGADT l :: TYPE ('BoxedRep l) + LPGADT l :: TYPE (BoxedRep l) |