summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_compile
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2020-03-09 09:57:39 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-11 08:18:32 -0400
commit0bc23338b02ffd624247ace409ab690b2b4a6186 (patch)
tree54316e29124a473b69d631802dc84b01b43ef887 /testsuite/tests/rename/should_compile
parent1daa20298880487b2a351c88f7ade840eb4632c6 (diff)
downloadhaskell-0bc23338b02ffd624247ace409ab690b2b4a6186.tar.gz
Re-quantify when generalising over rewrite rule types
Previously, `tcRules` would check for naughty quantification candidates (see `Note [Naughty quantification candidates]` in `TcMType`) when generalising over the type of a rewrite rule. This caused sensible-looking rewrite rules (like those in #17710) to be rejected. A more permissing (and easier-to-implement) approach is to do what is described in `Note [Generalising in tcTyFamInstEqnGuts]` in `TcTyClsDecls`: just re-quantify all the type variable binders, regardless of the order in which the user specified them. After all, the notion of type variable specificity has no real meaning in rewrite rules, since one cannot "visibly apply" a rewrite rule. I have written up this wisdom in `Note [Re-quantify type variables in rules]` in `TcRules`. As a result of this patch, compiling the `ExplicitForAllRules1` test case now generates one fewer warning than it used to. As far as I can tell, this is benign, since the thing that the disappearing warning talked about was also mentioned in an entirely separate warning. Fixes #17710.
Diffstat (limited to 'testsuite/tests/rename/should_compile')
-rw-r--r--testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr10
1 files changed, 0 insertions, 10 deletions
diff --git a/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr b/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
index a233fb4f50..0a575c9bb3 100644
--- a/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
+++ b/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
@@ -1,14 +1,4 @@
-ExplicitForAllRules1.hs:49:11: warning:
- Forall'd type variable ‘k’ is not bound in RULE lhs
- Orig bndrs: [k, a, b, x]
- Orig lhs: id' @a x
- optimised lhs: id' @a x
- Forall'd type variable ‘b’ is not bound in RULE lhs
- Orig bndrs: [k, a, b, x]
- Orig lhs: id' @a x
- optimised lhs: id' @a x
-
ExplicitForAllRules1.hs:49:31: warning: [-Wunused-foralls (in -Wextra)]
Unused quantified type variable ‘b’
in the rule "example7"