diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-02-25 08:31:33 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-05 03:09:41 -0500 |
commit | 80dfcee61e3bfb67f131cd674f96467e16c0f9d8 (patch) | |
tree | 3b486a446fa687097b66b99dc22424ec929e2aaf /testsuite/tests/indexed-types | |
parent | e6ce17433b75c6c985bffaf1f6fc18d299666ccb (diff) | |
download | haskell-80dfcee61e3bfb67f131cd674f96467e16c0f9d8.tar.gz |
Be more careful when naming TyCon binders
This patch fixes two rather gnarly test cases:
* Trac #16342 (mutual recursion)
See Note [Tricky scoping in generaliseTcTyCon]
* Trac #16221 (shadowing)
See Note [Unification variables need fresh Names]
The main changes are:
* Substantial reworking of TcTyClsDecls.generaliseTcTyCon
This is the big change, and involves the rather tricky
function TcHsSyn.zonkRecTyVarBndrs.
See Note [Inferring kinds for type declarations] and
Note [Tricky scoping in generaliseTcTyCon] for the details.
* bindExplicitTKBndrs_Tv and bindImplicitTKBndrs_Tv both now
allocate /freshly-named/ unification variables. Indeed, more
generally, unification variables are always fresh; see
Note [Unification variables need fresh Names] in TcMType
* Clarify the role of tcTyConScopedTyVars.
See Note [Scoped tyvars in a TcTyCon] in TyCon
As usual, this dragged in some more refactoring:
* Renamed TcMType.zonkTyCoVarBndr to zonkAndSkolemise
* I renamed checkValidTelescope to checkTyConTelescope;
it's only used on TyCons, and indeed takes a TyCon as argument.
* I folded the slightly-mysterious reportFloatingKvs into
checkTyConTelescope. (Previously all its calls immediately
followed a call to checkTyConTelescope.) It makes much more
sense there.
* I inlined some called-once functions to simplify
checkValidTyFamEqn. It's less spaghetti-like now.
* This patch also fixes Trac #16251. I'm not quite sure why #16251
went wrong in the first place, nor how this patch fixes it, but
hey, it's good, and life is short.
Diffstat (limited to 'testsuite/tests/indexed-types')
-rw-r--r-- | testsuite/tests/indexed-types/should_fail/all.T | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T index 8aef2e7673..4e29910c21 100644 --- a/testsuite/tests/indexed-types/should_fail/all.T +++ b/testsuite/tests/indexed-types/should_fail/all.T @@ -69,7 +69,7 @@ test('T2664a', normal, compile, ['']) test('T2544', normal, compile_fail, ['']) test('T1897b', normal, compile_fail, ['']) test('T5439', normal, compile_fail, ['']) -test('T5515', when(compiler_debugged(), expect_broken(16251)), compile_fail, ['']) +test('T5515', normal, compile_fail, ['']) test('T5934', normal, compile_fail, ['']) test('T6123', normal, compile_fail, ['']) test('ExtraTcsUntch', normal, compile_fail, ['']) |