summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-08-28 14:20:02 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-08-29 09:37:01 +0100
commit0257dacf228024d0cc6ba247c707130637a25580 (patch)
tree47809e6d47e6822d42d879b8b1dabd3bf96e1177 /testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr
parent6f050d9caa2db8330f73f5ebeee986371e5aa56d (diff)
downloadhaskell-0257dacf228024d0cc6ba247c707130637a25580.tar.gz
Refactor bindHsQTyVars and friends
This work was triggered by Trac #13738, which revealed to me that the code RnTypes.bindHsQTyVars and bindLHsTyVarBndrs was a huge tangled mess -- and outright wrong on occasion as the ticket showed. The big problem was that bindLHsTyVarBndrs (which is invoked at every HsForAll, including nested higher rank ones) was attempting to bind implicit kind variables, which it has absolutely no busineess doing. Imlicit kind quantification is done at the outside only, in fact precisely where we have HsImplicitBndrs or LHsQTyVars (which also has implicit binders). Achieving this move was surprisingly hard, because more and more barnacles had accreted aroud the original mistake. It's much much better now. Summary of changes. Almost all the action is in RnTypes. * Implicit kind variables are bound only by - By bindHsQTyVars, which deals with LHsQTyVars - By rnImplicitBndrs, which deals with HsImplicitBndrs * bindLHsTyVarBndrs, and bindLHsTyVarBndr are radically simplified. They simply does far less, and have lots their forest of incomprehensible accumulating parameters. (To be fair, some of the code in bindLHsTyVarBndrs just moved to bindHsQTyVars, but in much more perspicuous form.) * The code that checks if a variable appears in both a kind and a type (triggering RnTypes.mixedVarsErr) was bizarre. E.g. we had this in RnTypes.extract_hs_tv_bndrs ; check_for_mixed_vars bndr_kvs acc_tvs ; check_for_mixed_vars bndr_kvs body_tvs ; check_for_mixed_vars body_tvs acc_kvs ; check_for_mixed_vars body_kvs acc_tvs ; check_for_mixed_vars locals body_kvs I cleaned all this up; now we check for mixed use at binding sites only. * Checks for "Variable used as a kind before being bound", like data T (a :: k) k = rhs now just show up straightforwardly as "k is not in scope". See Note [Kind variable ordering] * There are some knock-on simplifications in RnSource.
Diffstat (limited to 'testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr')
-rw-r--r--testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr4
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr b/testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr
index 6c04646b81..92d8db7912 100644
--- a/testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr
+++ b/testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr
@@ -1,5 +1,5 @@
-SimpleFail6.hs:6:10: error:
+SimpleFail6.hs:7:11: error:
Conflicting definitions for ‘a’
- Bound at: SimpleFail6.hs:6:10
+ Bound at: SimpleFail6.hs:7:11
SimpleFail6.hs:7:13