summaryrefslogtreecommitdiff
path: root/testsuite/tests/gadt
Commit message (Collapse)AuthorAgeFilesLines
* Major patch to add -fwarn-redundant-constraintsSimon Peyton Jones2015-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea was promted by Trac #9939, but it was Christmas, so I did some recreational programming that went much further. The idea is to warn when a constraint in a user-supplied context is redundant. Everything is described in detail in Note [Tracking redundant constraints] in TcSimplify. Main changes: * The new ic_status field in an implication, of type ImplicStatus. It replaces ic_insol, and includes information about redundant constraints. * New function TcSimplify.setImplicationStatus sets the ic_status. * TcSigInfo has sig_report_redundant field to say whenther a redundant constraint should be reported; and similarly the FunSigCtxt constructor of UserTypeCtxt * EvBinds has a field eb_is_given, to record whether it is a given or wanted binding. Some consequential chagnes to creating an evidence binding (so that we record whether it is given or wanted). * AbsBinds field abs_ev_binds is now a *list* of TcEvBiinds; see Note [Typechecking plan for instance declarations] in TcInstDcls * Some significant changes to the type checking of instance declarations; Note [Typechecking plan for instance declarations] in TcInstDcls. * I found that TcErrors.relevantBindings was failing to zonk the origin of the constraint it was looking at, and hence failing to find some relevant bindings. Easy to fix, and orthogonal to everything else, but hard to disentangle. Some minor refactorig: * TcMType.newSimpleWanteds moves to Inst, renamed as newWanteds * TcClassDcl and TcInstDcls now have their own code for typechecking a method body, rather than sharing a single function. The shared function (ws TcClassDcl.tcInstanceMethodBody) didn't have much code and the differences were growing confusing. * Add new function TcRnMonad.pushLevelAndCaptureConstraints, and use it * Add new function Bag.catBagMaybes, and use it in TcSimplify
* Print singleton consraints without parensSimon Peyton Jones2015-01-064-66/+66
| | | | | | | | | | The main change is in TypeRep.pprTheta, so we print Eq a for a singleton, but (Eq a, Show a) for multiple constraints. There are lots of trivial knock-on changes to error messages
* Modify a couple of error messages slightlySimon Peyton Jones2015-01-0610-94/+89
| | | | | | | | | | | | In particular In the type signature for: f :: Int -> Int I added the colon Also reword the "maybe you haven't applied a function to enough arguments?" suggestion to make grammatical sense. These tiny changes affect a lot of error messages.
* Rewrite `Coercible` solverRichard Eisenberg2014-12-121-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a rewrite of the algorithm to solve for Coercible "instances". A preliminary form of these ideas is at https://ghc.haskell.org/trac/ghc/wiki/Design/NewCoercibleSolver The basic idea here is that the `EqPred` constructor of `PredTree` now is parameterised by a new type `EqRel` (where `data EqRel = NomEq | ReprEq`). Thus, every equality constraint can now talk about nominal equality (the usual case) or representational equality (the `Coercible` case). This is a change from the previous behavior where `Coercible` was just considered a regular class with a special case in `matchClassInst`. Because of this change, representational equalities are now canonicalized just like nominal ones, allowing more equalities to be solved -- in particular, the case at the top of #9117. A knock-on effect is that the flattener must be aware of the choice of equality relation, because the inert set now stores both representational inert equalities alongside the nominal inert equalities. Of course, we can use representational equalities to rewrite only within another representational equality -- thus the parameterization of the flattener. A nice side effect of this change is that I've introduced a new type `CtFlavour`, which tracks G vs. W vs. D, removing some ugliness in the flattener. This commit includes some refactoring as discussed on D546. It also removes the ability of Deriveds to rewrite Deriveds. This fixes bugs #9117 and #8984. Reviewers: simonpj, austin, nomeata Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D546 GHC Trac Issues: #9117, #8984
* Testsuite error message changesSimon Peyton Jones2014-11-044-24/+17
|
* Use correct precedence when printing contexts with class operatorsSimon Peyton Jones2014-10-071-1/+1
| | | | Fixes Trac #9658
* Mark type-rep not as expect_broken when debuggedJoachim Breitner2014-08-061-1/+1
| | | | Thanks to slyfox for noticing this reregression.
* Test Trac #9380Simon Peyton Jones2014-07-313-0/+72
|
* In splitHsFunType, take account of prefix (->)Simon Peyton Jones2014-05-122-0/+7
| | | | This fixes Trac #9096
* Normalize GHC Trac URLsHerbert Valerio Riedel2014-04-191-1/+1
| | | | | | | | | | | | | | Update several old http://hackage.haskell.org/trac/ghc URLs references to the current http://ghc.haskell.org/trac/ghc URLs. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Improve error reporting for untouchable type variablesSimon Peyton Jones2014-04-083-0/+3
| | | | | | | | | | | This change adds a suggestion Possible fix: add a type signature for ‘f’ when we have a GADT-style definition with a type we can't figure out. See Note [Suggest adding a type signature] in TcErrors. This initially came up in the discussion of Trac #8968.
* Use U+2018 instead of U+201B quote mark in compiler messagesHerbert Valerio Riedel2014-02-2519-75/+75
| | | | | | | 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>
* type-rep is only broken when debugging is onJoachim Breitner2014-01-161-1/+1
| | | | in which case it is a wontfix (see #8569)
* Update output: More elaborate GND error messagesJoachim Breitner2013-12-041-1/+2
|
* Wibbles to output caused by change in checking role annotationsRichard Eisenberg2013-12-021-1/+1
|
* Mark type-rep as broken until #5869 is fixedJoachim Breitner2013-12-021-1/+1
|
* Update testsuite for nicer Coercible messageJoachim Breitner2013-12-021-5/+6
|
* Coercible-base GND: update error messagesJoachim Breitner2013-11-221-5/+7
| | | | | (unfortunately, not to the better, these might need some more massaging.)
* gadt6 is fine now, even with DEBUGSimon Peyton Jones2013-11-221-1/+1
|
* Mark tests as expect_broken when borken with -DDEBUGJoachim Breitner2013-11-221-1/+1
| | | | The related bugs are #8553 and #8525.
* Update tests to reflect new check for GeneralizedNewtypeDerivingRichard Eisenberg2013-10-231-1/+1
|
* Adjust test suite to new Language Pragma warnignsJoachim Breitner2013-09-143-3/+3
| | | | (this is related to #3647)
* Error message wibblesSimon Peyton Jones2013-09-103-8/+8
| | | | | | | | | | | | Almost all are re-orderings of relevant-binding output Relevant bindings include + m :: Map (a, b) elt (bound at T3169.hs:12:17) + b :: b (bound at T3169.hs:12:13) lookup :: (a, b) -> Map (a, b) elt -> Maybe elt (bound at T3169.hs:12:3) - b :: b (bound at T3169.hs:12:13) - m :: Map (a, b) elt (bound at T3169.hs:12:17)
* Fix most AMP warnings.Austin Seipp2013-09-082-0/+20
| | | | | Authored-by: David Luposchainsky <dluposchainsky@gmail.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Wibble to output from change in roles error messagesRichard Eisenberg2013-08-271-1/+1
|
* Wibbles to output from refactoring datacon codeRichard Eisenberg2013-08-041-1/+1
|
* Add tests for roles.Richard Eisenberg2013-08-025-12/+19
| | | | | | Many of the files modified are just wibbles to output, because now tycons have roles attached to them, which are produced in the debugging dumps.
* Test Trac #7558Simon Peyton Jones2013-06-203-0/+22
|
* Test Trac #7974Simon Peyton Jones2013-06-102-0/+9
|
* Improved error messageSimon Peyton Jones2013-05-213-0/+3
|
* Wibbles to error messages, following the fix for Trac #7851Simon Peyton Jones2013-04-294-7/+0
| | | | | | | | 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-35/+21
|
* Update outputs following the unicode quote change in GHC's outputIan Lynagh2013-02-2417-133/+132
|
* More helper conversionsIan Lynagh2013-02-111-6/+6
|
* Convert more helper functionsIan Lynagh2013-02-111-4/+4
|
* spellingGabor Greif2013-02-021-1/+1
|
* Adapt to being a bit more picky about inference with GADTsSimon Peyton Jones2012-10-197-4/+66
| | | | | This means adding a few type signature, and some tests failing (as they should) rather than succeeding
* Improvements to kind error messages, mainlySimon Peyton Jones2012-10-191-0/+1
| | | | Also some expected/actual messages are now the right way round
* Replace Rank2Types and PolymorphicComponents by RankNTypesSimon Peyton Jones2012-10-196-6/+6
|
* Test Trac #7321Simon Peyton Jones2012-10-124-0/+20
|
* Commit missing stderr fileSimon Peyton Jones2012-10-081-1/+9
|
* Test Trac #7294Simon Peyton Jones2012-10-053-0/+35
|
* Test Trac #7293Simon Peyton Jones2012-10-053-0/+26
|
* Test Trac #7205Simon Peyton Jones2012-10-022-1/+17
|
* We now have left/right coercions again, so T1999a passesSimon Peyton Jones2012-10-021-1/+1
|
* Tons of error message wibblesSimon Peyton Jones2012-09-281-18/+0
|
* A ton of error message wibblesSimon Peyton Jones2012-09-212-20/+39
| | | | | | Notably * Showing relevant bindings * Not suggesting add instance (Num T); see Trac #7222
* Add some NOINLINE pragmas to satisfy the (correct) "RULE may not fire" warningSimon Peyton Jones2012-07-231-0/+1
|
* Testcases for floating equalities ouf of implicationsDimitrios.Vytiniotis2012-06-082-0/+19
| | | | and for recording extra untouchable variables.
* Error message modifications following ghc-new-solver modificationsDimitrios.Vytiniotis2012-04-042-32/+46
|