diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-11-22 11:55:00 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-11-22 13:14:02 -0500 |
commit | f5d2083807a03c57f194fcc3a7baf82e34aad524 (patch) | |
tree | 9853fb8ba47bbdd1488ded82672ca0087a7b2a98 /testsuite/tests/typecheck/should_fail/T6018fail.stderr | |
parent | ff619555439a8fc671fffb239910972b054a7d96 (diff) | |
download | haskell-f5d2083807a03c57f194fcc3a7baf82e34aad524.tar.gz |
Overhaul -fprint-explicit-kinds to use VKA
This patch changes the behavior of `-fprint-explicit-kinds`
so that it displays kind argument using visible kind application.
In other words, the flag now:
1. Prints instantiations of specified variables with `@(...)`.
2. Prints instantiations of inferred variables with `@{...}`.
In addition, this patch removes the `Use -fprint-explicit-kinds to
see the kind arguments` error message that often arises when a type
mismatch occurs due to different kinds. Instead, whenever there is a
kind mismatch, we now enable the `-fprint-explicit-kinds` flag
locally to help cue to the programmer where the error lies.
(See `Note [Kind arguments in error messages]` in `TcErrors`.)
As a result, these funny `@{...}` things can now appear to the user
even without turning on the `-fprint-explicit-kinds` flag explicitly,
so I took the liberty of documenting them in the users' guide.
Test Plan: ./validate
Reviewers: goldfire, simonpj, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, carter
GHC Trac Issues: #15871
Differential Revision: https://phabricator.haskell.org/D5314
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T6018fail.stderr')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T6018fail.stderr | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T6018fail.stderr b/testsuite/tests/typecheck/should_fail/T6018fail.stderr index 7f7dadd499..0e230e62c8 100644 --- a/testsuite/tests/typecheck/should_fail/T6018fail.stderr +++ b/testsuite/tests/typecheck/should_fail/T6018fail.stderr @@ -60,33 +60,31 @@ T6018fail.hs:53:15: error: T6018fail.hs:61:10: error: Type family equation violates injectivity annotation. Kind variable ‘k2’ cannot be inferred from the right-hand side. - Use -fprint-explicit-kinds to see the kind arguments In the type family equation: - PolyKindVarsF '[] = '[] -- Defined at T6018fail.hs:61:10 + PolyKindVarsF @{[k2]} @[k1] ('[] @k2) = '[] @k1 + -- Defined at T6018fail.hs:61:10 T6018fail.hs:64:15: error: Type family equation violates injectivity annotation. Kind variable ‘k1’ cannot be inferred from the right-hand side. - Use -fprint-explicit-kinds to see the kind arguments In the type family equation: - PolyKindVars '[] = '[] -- Defined at T6018fail.hs:64:15 + PolyKindVars @[k1] @[k2] ('[] @k1) = '[] @k2 + -- Defined at T6018fail.hs:64:15 T6018fail.hs:68:15: error: Type family equation violates injectivity annotation. Kind variable ‘k’ cannot be inferred from the right-hand side. - Use -fprint-explicit-kinds to see the kind arguments In the type family equation: forall k (a :: k) (b :: k). - Fc a b = Int -- Defined at T6018fail.hs:68:15 + Fc @k a b = Int -- Defined at T6018fail.hs:68:15 T6018fail.hs:72:15: error: Type family equation violates injectivity annotation. Type and kind variables ‘k’, ‘a’, ‘b’ cannot be inferred from the right-hand side. - Use -fprint-explicit-kinds to see the kind arguments In the type family equation: forall k (a :: k) (b :: k). - Gc a b = Int -- Defined at T6018fail.hs:72:15 + Gc @k a b = Int -- Defined at T6018fail.hs:72:15 T6018fail.hs:76:15: error: Type family equations violate injectivity annotation: @@ -140,10 +138,9 @@ T6018fail.hs:120:15: error: Type family equation violates injectivity annotation. Type and kind variables ‘k’, ‘c’ cannot be inferred from the right-hand side. - Use -fprint-explicit-kinds to see the kind arguments In the type family equation: forall k a b (c :: k). - G7 a b c = [G7a a b c] -- Defined at T6018fail.hs:120:15 + G7 @k a b c = [G7a @k a b c] -- Defined at T6018fail.hs:120:15 T6018fail.hs:131:1: error: Type family equations violate injectivity annotation: |