summaryrefslogtreecommitdiff
path: root/testsuite/tests
Commit message (Collapse)AuthorAgeFilesLines
* Major patch to add -fwarn-redundant-constraintsSimon Peyton Jones2015-01-06171-502/+703
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0652-483/+482
| | | | | | | | | | 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-0684-1369/+1357
| | | | | | | | | | | | 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.
* Updaete perf numbers for 32-bit machinesSimon Peyton Jones2015-01-061-9/+20
|
* Make the location in TcLclEnv and CtLoc into a RealSrcSpanSimon Peyton Jones2015-01-064-7/+7
| | | | | | | | | | | Previously it was a SrcSpan, which can be an UnhelpulSrcSpan, but actually for TcLclEnv and CtLoc we always know it is a real source location, and it's good to make the types reflect that fact. There is a continuing slight awkwardness (not new with this patch) about what "file name" to use for GHCi code. Current we say "<interactive>" which seems just about OK.
* Update Cabal submodule to latest 1.22 snapshotHerbert Valerio Riedel2015-01-031-4/+0
|
* Fix #9243 so recompilation avoidance works with -fno-codeEdward Z. Yang2015-01-0320-1/+126
| | | | | | | | | | | | | | | | | | | | | | | Summary: Where we track timestamps of object files, also track timestamps for interface files. When -fno-code -fwrite-interface is enabled, use the interface file timestamp as an extra check to see if the files are up-to-date. We had to apply this logic to one-shot and make modes. This fix would be good to merge into 7.10; it makes using -fno-code -fwrite-interface for flywheel type checking usable. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate and new test cases Reviewers: austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D596 GHC Trac Issues: #9243
* Mark T9938 as not brokenJoachim Breitner2015-01-031-1/+1
| | | | | either one of the two recent commits (d8d0031, fd97d2a) fixed it, or there is some nondeterminism here. See #9938.
* Refine test case for #9938Joachim Breitner2014-12-303-2/+26
| | | | | | | | | By passing -O2, the bug appears depending on the order of clauses in "solve", hence adding T9938B as the other variant. Currently, T9938 is marked as broken, but maybe the bug is actually in T9938B, where something (possibly inlining, as suggested by rwbarton) affected the requirement to link against transformers.
* Test case for #9938Joachim Breitner2014-12-293-0/+23
| | | | Marked as known_broken
* Skip T2276_ghci on Darwin, since stdcall is not supported.Edward Z. Yang2014-12-291-0/+1
| | | | | | | | | | | | | | Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, erikd Reviewed By: erikd Subscribers: erikd, carter, thomie Differential Revision: https://phabricator.haskell.org/D588
* Support pattern synonyms in GHCi (fixes #9900)Dr. ERDI Gergo2014-12-284-0/+18
| | | | | | This involves recognizing lines starting with `"pattern "` as declarations, keeping non-exported pattern synonyms in `deSugar`, and including pattern synonyms in the result of `hscDeclsWithLocation`.
* Run T9762 only if dynamic libraries are availableJoachim Breitner2014-12-271-2/+5
|
* 2nd attempt to fix T9032 test-caseHerbert Valerio Riedel2014-12-254-4/+2
| | | | | | First attempt via 7a2c9dde24b72f wasn't working properly. This attempt should work better as it doesn't cause the makefile recipe to fail which causes `make` to emit additional varying output.
* Fix linker interaction between Template Haskell and HPC (#9762)Reid Barton2014-12-236-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I'm not really happy about perpetuating the hackish fix for #8696, but at least in the context of building with -fhpc, the performance cost should be negligible. I'm suspicious about PlainModuleInitLabel and the Windows stuff too, but I don't know what it does / can't test it (respectively) so I'll leave those alone for now. Hopefully out-of-process TH will save us from these hacks some day. The test is an adaptation of T8696. It's a bit more awkward since I couldn't think of a way to get cross-module tickbox references without optimizations (inlining), but ghci doesn't permit -O for some reason. Test Plan: harbormaster; validate Reviewers: austin Reviewed By: austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D583 GHC Trac Issues: #9762 Conflicts: testsuite/tests/ghci/scripts/all.T
* Make ghc -e fail on invalid declarationsReid Barton2014-12-235-0/+17
| | | | | | | | | | | | | | | | | Summary: Note: This commit includes an API change to GhciMonad.runDecls to allow the caller to determine whether the declarations were run successfully or not. Test Plan: harbormaster Reviewers: austin Reviewed By: austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D582
* Make ghc -e not exit on valid import commands (#9905)Reid Barton2014-12-236-1/+30
| | | | | | | | | | | | | | | | | | | | | Summary: Some Trues and Falses were mixed up due to Bool being used in different senses in different parts of GHCi. Test Plan: harbormaster; validate Reviewers: austin Reviewed By: austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D581 GHC Trac Issues: #9905 Conflicts: ghc/InteractiveUI.hs
* Fixup edd233acc19d269385 (T9032 test)Herbert Valerio Riedel2014-12-232-1/+2
| | | | | This is not a proper fix as the `x` in `make[x]: ...` changes depending on how the testsuite was called. So this probably only works when invoked via ./validate.
* Test earlier for self-import (Trac #9032)Simon Peyton Jones2014-12-234-0/+25
| | | | | | | | | This patch makes the renamer check for self-import, especially when dependencies change, because the typechecker can fall over if that happens. I'm still uneasy about *indirect* self-import, but I'll leave that for another day
* Attempt to improve cleaningSimon Peyton Jones2014-12-233-4/+8
| | | | | | | I found several tests that failed when the interface file format changed, due to leftover .hi file droppings. I'm not sure I've done this right, but it should be a bit better
* Eliminate so-called "silent superclass parameters"Simon Peyton Jones2014-12-2323-182/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of silent superclass parameters was to solve the awkward problem of superclass dictinaries being bound to bottom. See THE PROBLEM in Note [Recursive superclasses] in TcInstDcls Although the silent-superclass idea worked, * It had non-local consequences, and had effects even in Haddock, where we had to discard silent parameters before displaying instance declarations * It had unexpected peformance costs, shown up by Trac #3064 and its test case. In monad-transformer code, when constructing a Monad dictionary you had to pass an Applicative dictionary; and to construct that you neede a Functor dictionary. Yet these extra dictionaries were often never used. (All this got much worse when we added Applicative as a superclass of Monad.) Test T3064 compiled *far* faster after silent superclasses were eliminated. * It introduced new bugs. For example SilentParametersOverlapping, T5051, and T7862, all failed to compile because of instance overlap directly because of the silent-superclass trick. So this patch takes a new approach, which I worked out with Dimitrios in the closing hours before Christmas. It is described in detail in THE PROBLEM in Note [Recursive superclasses] in TcInstDcls. Seems to work great! Quite a bit of knock-on effect * The main implementation work is in tcSuperClasses in TcInstDcls Everything else is fall-out * IdInfo.DFunId no longer needs its n-silent argument * Ditto IDFunId in IfaceSyn * Hence interface file format changes * Now that DFunIds do not have silent superclass parameters, printing out instance declarations is simpler. There is tiny knock-on effect in Haddock, so that submodule is updated * I realised that when computing the "size of a dictionary type" in TcValidity.sizePred, we should be rather conservative about type functions, which can arbitrarily increase the size of a type. Hence the new datatype TypeSize, which has a TSBig constructor for "arbitrarily big". * instDFunType moves from TcSMonad to Inst * Interestingly, CmmNode and CmmExpr both now need a non-silent (Ord r) in a couple of instance declarations. These were previously silent but must now be explicit. * Quite a bit of wibbling in error messages
* Rename NamedWildcards flag to NamedWildCardsThomas Winant2014-12-2323-23/+23
| | | | | | | | | | | | | | | | Summary: Mind the capital C. As there is already a flag RecordWildCards with a capital C, we should at least try to be consistent in the spelling of WildCards. Test Plan: validate Reviewers: goldfire, simonpj, austin Reviewed By: simonpj, austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D584
* Fix panic on :kind _ in GHCi (Trac #9879)Thomas Winant2014-12-234-0/+9
| | | | | | | | | | | | | | | | | | | | | | | Summary: Running `:kind _` in GHCi produced a panic, fix it by extracting the wildcards. Now, `:kind _` produces `_ :: k0`. Unfortunately, a `0` is added after the kind is tidied and I haven't found a way to get rid of it... This does not fix the other panic involving TemplateHaskell mentioned in #9879. Test Plan: new test GHCiWildcardKind should pass Reviewers: austin, simonpj Reviewed By: austin Subscribers: simonpj, carter, thomie, monoidal Differential Revision: https://phabricator.haskell.org/D572 GHC Trac Issues: #9879
* fix spInfoSrcLoc field nameFacundo Domínguez2014-12-221-5/+5
| | | | | | Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D574
* Groom comments related to StaticPointers.Facundo Domínguez2014-12-223-10/+8
| | | | | | Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D575
* For :info, return all matching Names, rather than complaining about ambiguitySimon Peyton Jones2014-12-224-1/+37
| | | | | This fixes Trac #9881, and gives more helpful output in the case of ambiguity. Certainly more helpful than the positively-misleading error we get right now.
* Update containers submodule to 0.5.6.2 releaseHerbert Valerio Riedel2014-12-221-2/+2
|
* Update pretty and random submodulesHerbert Valerio Riedel2014-12-221-2/+3
| | | | | This updates those two packages to their most recent respective proper releases.
* Strip leading whitespace before checking if a statement looks like a ↵Dr. ERDI Gergo2014-12-223-0/+15
| | | | declaration (fixes #9914)
* Add expected output to T9915 testDr. ERDI Gergo2014-12-212-0/+4
|
* Check dflags for language extensions when deciding if "foreign " and "deriving "Dr. ERDI Gergo2014-12-212-0/+6
| | | | look like prefixes of valid declarations (fixes #9915)
* Change performance numbers for T3064Richard Eisenberg2014-12-191-1/+2
|
* Optimize flattener by trying to reduce a TF before reducing its args.Richard Eisenberg2014-12-191-5/+9
| | | | | This has a demonstrated 2x speed boost on the T9872{a,b,c} tests. (#9872)
* Add instance Lift NaturalRichard Eisenberg2014-12-191-0/+4
|
* Add Jan Stolarek's test for Trac #9872Simon Peyton Jones2014-12-192-0/+157
|
* Merge some instances from th-orphans.Richard Eisenberg2014-12-192-0/+76
|
* Consider equality contexts exotic, uninferrable by "deriving"Richard Eisenberg2014-12-194-1/+6
| | | | See comments in #8984. This takes back the fix for #6088.
* Add Data.Version.makeVersion & `IsList Version`Herbert Valerio Riedel2014-12-191-3/+6
| | | | | | | | | | | | | | | | These two facilities provide some means to avoid the double-breakage caused by first by the deprecation (see #2496), and then again by the actual future field-removal. See also https://groups.google.com/d/msg/haskell-core-libraries/q9H-QlL_gnE/4lbb_mBjre8J for details about this library addition. Reviewed By: ekmett Differential Revision: https://phabricator.haskell.org/D577
* Update Cabal submodule to 1.22 versionHerbert Valerio Riedel2014-12-181-1/+0
|
* Update `bytestring` submoduleHerbert Valerio Riedel2014-12-181-1/+1
| | | | this just pulls in the version bump to 0.10.6
* Fix wrong-kind-of-family error message (Trac #9896)Simon Peyton Jones2014-12-185-6/+20
|
* Minor typo in commentGabor Greif2014-12-171-1/+1
|
* Performance enhancements in TcFlatten.Richard Eisenberg2014-12-171-5/+11
| | | | | | | | | | | | | | | This commit fixes some performance regressions introduced by 0cc47eb, adding more `Coercible` magic to the solver. See Note [flatten_many performance] in TcFlatten for more info. The improvements do not quite restore the old numbers. Given that the solver is really more involved now, I am accepting this regression. The way forward (I believe) would be to have *two* flatteners: one that deals only with nominal equalities and thus never checks roles, and the more general one. A nice design of keeping this performant without duplicating code eludes me, but someone else is welcome to take a stab.
* Wibble error messageSimon Peyton Jones2014-12-171-1/+1
|
* Fix egregious bug in the new canonicalisation code for AppTySimon Peyton Jones2014-12-172-0/+18
| | | | | | Fixes Trac #9892. Must form part of 7.10.1
* Comment in testSimon Peyton Jones2014-12-171-0/+10
|
* Improve TidyPgm.hasCafRefs to account for Integer literals (Trac #8525)Simon Peyton Jones2014-12-171-2/+1
| | | | | | | | | | | | | | See Note [Disgusting computation of CafRefs] in TidyPgm. Also affects CoreUtils.rhsIsStatic. The real solution here is to compute CAF and arity information from the STG-program, and feed it back to tidied program for the interface file and later GHCi clients. A battle for another day. But at least this commit reduces the number of gratuitous CAFs, and hence SRT entries. And kills off a batch of ASSERT failures.
* Fix the scope-nesting for arrowsSimon Peyton Jones2014-12-173-7/+7
| | | | | | | | | | | | | | | Previously we were capturing the *entire environment* when moving under a 'proc', for the newArrowScope/escapeArrowScope thing. But that a blunderbuss, and in any case isn't right (the untouchable-type-varaible invariant gets invalidated). So I fixed it to be much more refined: just the LocalRdrEnv and constraints are captured. I think this is right; but if not we should just add more fields to ArrowCtxt, not return to the blunderbuss. This patch fixes the ASSERT failure in Trac #5267
* Typos in commentsGabor Greif2014-12-171-2/+2
|
* update containers submodules to 0.5.6.1 releaseHerbert Valerio Riedel2014-12-161-2/+2
|