diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-01-31 16:20:09 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-05 19:22:25 -0500 |
commit | 549292eb3725eca61722ddd2cfb4d964ccba3fc7 (patch) | |
tree | 302c5e889a1474c8910a06897b306357b6bd704a /testsuite/tests/partial-sigs | |
parent | 299acff08aa1b7b720ad2b69c459c514033bc395 (diff) | |
download | haskell-549292eb3725eca61722ddd2cfb4d964ccba3fc7.tar.gz |
Make implication tidying agree with Note [Tidying multiple names at once]
Note [Tidying multiple names at once] indicates that if multiple
variables have the same name then we shouldn't prioritise one of them
and instead rename them all to a1, a2, a3... etc
This patch implements that change, some error message changes as
expected.
Closes #20932
Diffstat (limited to 'testsuite/tests/partial-sigs')
6 files changed, 50 insertions, 50 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.stderr b/testsuite/tests/partial-sigs/should_compile/T10403.stderr index e329410514..fd38a126c2 100644 --- a/testsuite/tests/partial-sigs/should_compile/T10403.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr @@ -2,23 +2,23 @@ T10403.hs:16:7: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found extra-constraints wildcard standing for ‘Functor f’ Where: ‘f’ is a rigid type variable bound by - the inferred type of h1 :: Functor f => (a -> a1) -> f a -> H f + the inferred type of h1 :: Functor f => (a1 -> a2) -> f a1 -> H f at T10403.hs:18:1-41 • In the type signature: h1 :: _ => _ T10403.hs:16:12: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘(a -> a1) -> f a -> H f’ - Where: ‘a1’, ‘a’, ‘f’ are rigid type variables bound by - the inferred type of h1 :: Functor f => (a -> a1) -> f a -> H f + • Found type wildcard ‘_’ standing for ‘(a1 -> a2) -> f a1 -> H f’ + Where: ‘a2’, ‘a1’, ‘f’ are rigid type variables bound by + the inferred type of h1 :: Functor f => (a1 -> a2) -> f a1 -> H f at T10403.hs:18:1-41 • In the type signature: h1 :: _ => _ T10403.hs:20:7: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ - standing for ‘(a -> a1) -> B t0 a -> H (B t0)’ + standing for ‘(a1 -> a2) -> B t0 a1 -> H (B t0)’ Where: ‘t0’ is an ambiguous type variable - ‘a1’, ‘a’ are rigid type variables bound by - the inferred type of h2 :: (a -> a1) -> B t0 a -> H (B t0) + ‘a2’, ‘a1’ are rigid type variables bound by + the inferred type of h2 :: (a1 -> a2) -> B t0 a1 -> H (B t0) at T10403.hs:23:1-41 • In the type signature: h2 :: _ @@ -26,11 +26,11 @@ T10403.hs:29:8: warning: [-Wdeferred-type-errors (in -Wdefault)] • Couldn't match type ‘t0’ with ‘t’ Expected: H (B t) Actual: H (B t0) - because type variable ‘t’ would escape its scope - This (rigid, skolem) type variable is bound by - the type signature for: - app2 :: forall t. H (B t) - at T10403.hs:28:1-15 + • because type variable ‘t’ would escape its scope + This (rigid, skolem) type variable is bound by + the type signature for: + app2 :: forall t. H (B t) + at T10403.hs:28:1-15 • In the expression: h2 (H . I) (B ()) In an equation for ‘app2’: app2 = h2 (H . I) (B ()) • Relevant bindings include diff --git a/testsuite/tests/partial-sigs/should_compile/T10438.stderr b/testsuite/tests/partial-sigs/should_compile/T10438.stderr index 164007679c..358fb52ba8 100644 --- a/testsuite/tests/partial-sigs/should_compile/T10438.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T10438.stderr @@ -1,8 +1,8 @@ T10438.hs:7:22: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘p2’ - Where: ‘p2’ is a rigid type variable bound by - the inferred type of g :: p2 -> p2 + • Found type wildcard ‘_’ standing for ‘p3’ + Where: ‘p3’ is a rigid type variable bound by + the inferred type of g :: p3 -> p3 at T10438.hs:(6,9)-(8,21) • In the type signature: x :: _ In an equation for ‘g’: @@ -21,7 +21,7 @@ T10438.hs:7:22: warning: [-Wpartial-type-signatures (in -Wdefault)] x :: _ x = r • Relevant bindings include - r :: p2 (bound at T10438.hs:6:11) - g :: p2 -> p2 (bound at T10438.hs:6:9) - f :: p (bound at T10438.hs:5:5) - foo :: p -> p1 -> p1 (bound at T10438.hs:5:1) + r :: p3 (bound at T10438.hs:6:11) + g :: p3 -> p3 (bound at T10438.hs:6:9) + f :: p1 (bound at T10438.hs:5:5) + foo :: p1 -> p2 -> p2 (bound at T10438.hs:5:1) diff --git a/testsuite/tests/partial-sigs/should_compile/T11192.stderr b/testsuite/tests/partial-sigs/should_compile/T11192.stderr index 8030276206..6cfbe62628 100644 --- a/testsuite/tests/partial-sigs/should_compile/T11192.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T11192.stderr @@ -19,9 +19,9 @@ T11192.hs:7:14: warning: [-Wpartial-type-signatures (in -Wdefault)] • Relevant bindings include fails :: a (bound at T11192.hs:6:1) T11192.hs:13:14: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘p -> p1 -> p1’ - Where: ‘p’, ‘p1’ are rigid type variables bound by - the inferred type of go :: p -> p1 -> p1 + • Found type wildcard ‘_’ standing for ‘p1 -> p2 -> p2’ + Where: ‘p1’, ‘p2’ are rigid type variables bound by + the inferred type of go :: p1 -> p2 -> p2 at T11192.hs:14:8-17 • In the type signature: go :: _ In the expression: diff --git a/testsuite/tests/partial-sigs/should_compile/T12844.stderr b/testsuite/tests/partial-sigs/should_compile/T12844.stderr index 331570aa93..52c0d8c7d1 100644 --- a/testsuite/tests/partial-sigs/should_compile/T12844.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T12844.stderr @@ -2,7 +2,7 @@ T12844.hs:12:9: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found extra-constraints wildcard standing for ‘(Head rngs ~ '(r, r'), Foo rngs)’ - Where: ‘r’, ‘r'’, ‘k’, ‘k1’, ‘rngs’ + Where: ‘r’, ‘r'’, ‘k1’, ‘k2’, ‘rngs’ are rigid type variables bound by the inferred type of bar :: (Head rngs ~ '(r, r'), Foo rngs) => FooData rngs diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr index fbbfc6e4c9..a7a5ee85be 100644 --- a/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr +++ b/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr @@ -1,17 +1,17 @@ TidyClash.hs:8:19: error: - • Found type wildcard ‘_’ standing for ‘w’ - Where: ‘w’ is a rigid type variable bound by - the inferred type of bar :: w_ -> (w_, w -> w1) + • Found type wildcard ‘_’ standing for ‘w1’ + Where: ‘w1’ is a rigid type variable bound by + the inferred type of bar :: w_ -> (w_, w1 -> w2) at TidyClash.hs:9:1-28 To use the inferred type, enable PartialTypeSignatures • In the type ‘w_ -> (w_, _ -> _)’ In the type signature: bar :: w_ -> (w_, _ -> _) TidyClash.hs:8:24: error: - • Found type wildcard ‘_’ standing for ‘w1’ - Where: ‘w1’ is a rigid type variable bound by - the inferred type of bar :: w_ -> (w_, w -> w1) + • Found type wildcard ‘_’ standing for ‘w2’ + Where: ‘w2’ is a rigid type variable bound by + the inferred type of bar :: w_ -> (w_, w1 -> w2) at TidyClash.hs:9:1-28 To use the inferred type, enable PartialTypeSignatures • In the type ‘w_ -> (w_, _ -> _)’ diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr index 7e6b1da683..504fbf5094 100644 --- a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr +++ b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr @@ -1,26 +1,26 @@ TidyClash2.hs:13:20: error: - • Found type wildcard ‘_’ standing for ‘w’ - Where: ‘w’ is a rigid type variable bound by - the inferred type of barry :: w -> w1 -> t + • Found type wildcard ‘_’ standing for ‘w1’ + Where: ‘w1’ is a rigid type variable bound by + the inferred type of barry :: w1 -> w2 -> t at TidyClash2.hs:14:1-40 To use the inferred type, enable PartialTypeSignatures • In the type ‘_ -> _ -> t’ In the type signature: barry :: forall t. _ -> _ -> t TidyClash2.hs:13:25: error: - • Found type wildcard ‘_’ standing for ‘w1’ - Where: ‘w1’ is a rigid type variable bound by - the inferred type of barry :: w -> w1 -> t + • Found type wildcard ‘_’ standing for ‘w2’ + Where: ‘w2’ is a rigid type variable bound by + the inferred type of barry :: w1 -> w2 -> t at TidyClash2.hs:14:1-40 To use the inferred type, enable PartialTypeSignatures • In the type ‘_ -> _ -> t’ In the type signature: barry :: forall t. _ -> _ -> t TidyClash2.hs:14:13: error: - • Found type wildcard ‘_’ standing for ‘w’ - Where: ‘w’ is a rigid type variable bound by - the inferred type of barry :: w -> w1 -> t + • Found type wildcard ‘_’ standing for ‘w1’ + Where: ‘w1’ is a rigid type variable bound by + the inferred type of barry :: w1 -> w2 -> t at TidyClash2.hs:14:1-40 To use the inferred type, enable PartialTypeSignatures • In a pattern type signature: _ @@ -28,12 +28,12 @@ TidyClash2.hs:14:13: error: In an equation for ‘barry’: barry (x :: _) (y :: _) = undefined :: _ • Relevant bindings include - barry :: w -> w1 -> t (bound at TidyClash2.hs:14:1) + barry :: w1 -> w2 -> t (bound at TidyClash2.hs:14:1) TidyClash2.hs:14:22: error: - • Found type wildcard ‘_’ standing for ‘w1’ - Where: ‘w1’ is a rigid type variable bound by - the inferred type of barry :: w -> w1 -> t + • Found type wildcard ‘_’ standing for ‘w2’ + Where: ‘w2’ is a rigid type variable bound by + the inferred type of barry :: w1 -> w2 -> t at TidyClash2.hs:14:1-40 To use the inferred type, enable PartialTypeSignatures • In a pattern type signature: _ @@ -41,13 +41,13 @@ TidyClash2.hs:14:22: error: In an equation for ‘barry’: barry (x :: _) (y :: _) = undefined :: _ • Relevant bindings include - x :: w (bound at TidyClash2.hs:14:8) - barry :: w -> w1 -> t (bound at TidyClash2.hs:14:1) + x :: w1 (bound at TidyClash2.hs:14:8) + barry :: w1 -> w2 -> t (bound at TidyClash2.hs:14:1) TidyClash2.hs:14:40: error: - • Found type wildcard ‘_’ standing for ‘w2’ - Where: ‘w2’ is a rigid type variable bound by - the inferred type of <expression> :: w2 + • Found type wildcard ‘_’ standing for ‘w3’ + Where: ‘w3’ is a rigid type variable bound by + the inferred type of <expression> :: w3 at TidyClash2.hs:14:40 To use the inferred type, enable PartialTypeSignatures • In an expression type signature: _ @@ -55,6 +55,6 @@ TidyClash2.hs:14:40: error: In an equation for ‘barry’: barry (x :: _) (y :: _) = undefined :: _ • Relevant bindings include - y :: w1 (bound at TidyClash2.hs:14:17) - x :: w (bound at TidyClash2.hs:14:8) - barry :: w -> w1 -> t (bound at TidyClash2.hs:14:1) + y :: w2 (bound at TidyClash2.hs:14:17) + x :: w1 (bound at TidyClash2.hs:14:8) + barry :: w1 -> w2 -> t (bound at TidyClash2.hs:14:1) |