summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/mc25.stderr
Commit message (Collapse)AuthorAgeFilesLines
* Fix TcSimplify.decideQuantification for kind variablesSimon Peyton Jones2017-03-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TcSimplify.decideQuantification was doing the Wrong Thing when "growing" the type variables to quantify over. We were trying to do this on a tyvar set where we'd split off the dependent type varaibles; and we just got it wrong. A kind variable wasn't being generalised properly, with confusing knock on consequences. All this led to Trac #13371 and Trac #13393. This commit tidies it all up: * The type TcDepVars is renamed as CandidateQTvs; and splitDepVarsOfType to candidateQTyVarsOfType * The code in TcSimplify.decideQuantification is simpler. It no longer does the tricky "grow" stuff over TcDepVars. Instead it use ordinary VarSets (thereby eliminating the nasty growThetaTyVarsDSet) and uses that to filter the result of candidateQTyVarsOfType. * I documented that candidateQTyVarsOfType returns the type variables in a good order in which to quantify, and rewrote it to use an accumulator pattern, so that we would predicatably get left-to-right ordering. In doing all this I also made UniqDFM behave a little more nicely: * When inserting an element that is there already, keep the old tag, while still overwriting with the new value. * This means that when doing udfmToList we get back elements in the order they were originally inserted, rather than in reverse order. It's not a big deal, but in a subsequent commit I use it to improve the order of type variables in inferred types. All this led to a lot of error message wibbles: - changing the order of quantified variables - changing the order in which instances are listed in GHCi - changing the tidying of variables in typechecker erors There's a submodule update for 'array' because one of its tests has an error-message change. I may not have associated all of them with the correct commit.
* Testsuite: delete Windows line endings [skip ci] (#11631)Thomas Miedema2016-02-231-9/+9
|
* Improve error message suppressionSimon Peyton Jones2016-02-151-20/+9
| | | | | | | | | TcErrors has a system for suppressing some type errors if a more serious one occurs. But there was a crucial missing case, which sometimes resulted in a cascade of irrelevant errors overwhelming the actual cause. This was Trac #11541. The fix is simple. Worth merging to 8.0
* Visible type applicationRichard Eisenberg2015-12-241-14/+16
| | | | | | | | | | | | | This re-working of the typechecker algorithm is based on the paper "Visible type application", by Richard Eisenberg, Stephanie Weirich, and Hamidhasan Ahmed, to be published at ESOP'16. This patch introduces -XTypeApplications, which allows users to say, for example `id @Int`, which has type `Int -> Int`. See the changes to the user manual for details. This patch addresses tickets #10619, #5296, #10589.
* Rearrange error msgs and add section markers (Trac #11014).Evan Laforge2015-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This puts the "Relevant bindings" section at the end. It uses a TcErrors.Report Monoid to divide messages by importance and then mappends them together. This is not the most efficient way since there are various intermediate Reports and list appends, but it probably doesn't matter since error messages shouldn't get that large, and are usually prepended. In practice, everything is `important` except `relevantBindings`, which is `supplementary`. ErrMsg's errMsgShortDoc and errMsgExtraInfo were extracted into ErrDoc, which has important, context, and suppelementary fields. Each of those three sections is marked with a bullet character, '•' on unicode terminals and '*' on ascii terminals. Since this breaks tons of tests, I also modified testlib.normalise_errmsg to strip out '•'s. --- Additional notes: To avoid prepending * to an empty doc, I needed to filter empty docs. This seemed less error-prone than trying to modify everyone who produces SDoc to instead produce Maybe SDoc. So I added `Outputable.isEmpty`. Unfortunately it needs a DynFlags, which is kind of bogus, but otherwise I think I'd need another Empty case for SDoc, and then it couldn't be a newtype any more. ErrMsg's errMsgShortString is only used by the Show instance, which is in turn only used by Show HscTypes.SourceError, which is in turn only needed for the Exception instance. So it's probably possible to get rid of errMsgShortString, but that would a be an unrelated cleanup. Fixes #11014. Test Plan: see above Reviewers: austin, simonpj, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: simonpj, nomeata, thomie Differential Revision: https://phabricator.haskell.org/D1427 GHC Trac Issues: #11014
* Improve improvement in the constraint solverSimon Peyton Jones2015-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This regrettably-big patch substantially improves the way in which "improvement" happens in the constraint solver. It was triggered by trying to crack Trac #10009, but it turned out to solve #10340 as well. The big picture, with several of the trickiest examples, is described in Note [The improvement story] in TcInteract. The major change is this: * After solving we explicitly try "improvement", by - making the unsolved Wanteds into Deriveds - allowing Deriveds to rewrite Deriveds This more aggressive rewriting "unlocks" some extra guess-free unifications. * The main loop is in TcInteract.solveSimpleWanteds, but I also ended up refactoring TcSimplify.simpl_loop, and its surrounding code. Notably, any insolubles from the Givens are pulled out and treated separately, rather than staying in the inert set during the solveSimpleWanteds loop. There are a lot of follow-on changes * Do not emit generate Derived improvements from Wanteds. This saves work in the common case where they aren't needed. * For improvement we should really do type-class reduction on Derived constraints in doTopReactDict. That entailed changing the GenInst constructor a bit; a local and minor change * Some annoying faffing about with dropping derived constraints; see dropDerivedWC, dropDerivedSimples, dropDerivedInsols, and their Notes. * Some substantial refactoring in TcErrors.reportWanteds. This work wasn't strictly forced, but I got sucked into it. All the changes are in TcErrors. * Use TcS.unifyTyVar consistently, rather than setWantedTyBind, so that unifications are properly tracked. * Refactoring around solveWantedsTcM, solveWantedsAndDrop. They previously guaranteed a zonked result, but it's more straightforward for clients to zonk.
* The production for squals is incorrect; see D806 for specifics.Alan Zimmerman2015-04-071-1/+1
| | | | | | | | | | This diff depends on D803. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D806 GHC Trac Issues: #10214
* Wibbles (usually improvements) to error messagesSimon Peyton Jones2014-11-211-18/+18
|
* Testsuite error message changesSimon Peyton Jones2014-11-041-18/+18
|
* Do not discard insoluble Derived constraintsSimon Peyton Jones2014-09-261-7/+7
| | | | | | | | | | | | | | | | | | This is preparing for a fix to Trac #9612. The idea is that insoluble constraints are nice solid errors that we should not discard before we have a chance to report them. So TcRnTypes.dropDerivedWC now keeps insoluble Derived constrains, and instead TcSimplify.solve_wanteds filters them out We get somewhat better error message for kind-equality failures too. A slight downside is that to avoid *duplicate* kind-equality failures when we float a kind-incompatible equality (e.g. alpha:* ~ Int#), I've disabled constraint-floating when there are insolubles. But that in turn makes a handful of error messages a little less informative; good examples are mc21, mc22, mc25. But I am re-jigging the constraint floating machinery in another branch, which will make this go back to the way it was before.
* Use U+2018 instead of U+201B quote mark in compiler messagesHerbert Valerio Riedel2014-02-251-2/+2
| | | | | | | This matches GCC's choice of Unicode quotation marks (i.e. U+2018 and U+2019) and therefore looks more familiar on the console. This addresses #2507. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Wibbles to error messages, following the fix for Trac #7851Simon Peyton Jones2013-04-291-19/+18
| | | | | | | | In effect, the error context for naked variables now takes up a "slot" in the context stack; but it is often empty. So the context stack becomes one shorter in those cases. I don't think this matters; indeed, it's aguably an improvement. Anyway that's why so many tests are affected.
* Error message wibbles, following TcErrors refactoringSimon Peyton Jones2013-04-221-9/+19
|
* Update outputs following the unicode quote change in GHC's outputIan Lynagh2013-02-241-1/+1
|
* A ton of error message wibblesSimon Peyton Jones2012-09-211-8/+9
| | | | | | Notably * Showing relevant bindings * Not suggesting add instance (Num T); see Trac #7222
* Accept error wibblesSimon Peyton Jones2012-07-101-50/+8
|
* Follow the move of Word from base to ghc-primIan Lynagh2012-05-221-4/+6
|
* Raft of wibbles after refactoring type-class constraint errorsSimon Peyton Jones2012-03-091-4/+17
| | | | ...in response to Trac #5858
* Lots of error message wibbling, following theSimon Peyton Jones2012-01-121-3/+31
| | | | major TcErrors refactoring
* Move tests from tests/ghc-regress/* to just tests/*David Terei2011-07-201-0/+7