summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* Be a bit more aggressive about let-to-caseSimon Peyton Jones2018-09-124-1/+27
| | | | | | | | | | This patch takes up the missed opportunity described in Trac #15631, by convering a case into a let slightly more agressively. See Simplify.hs Note [Case-to-let for strictly-used binders] There is no measurable perf impact for good or ill. But the code is simpler and easier to explain.
* Update UnsafeReenter testÖmer Sinan Ağacan2018-09-101-11/+6
| | | | | | | | | | | | | | | Only run the test in non-threaded, compiled mode. It hangs with threaded runtime (which stage 2 compiler uses, so disable it for ghci too). Reviewers: simonmar, alpmestan, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #14912 Differential Revision: https://phabricator.haskell.org/D5136
* ghc: Remove warning of StaticPointers not being supported by GHCiBen Gamari2018-09-071-3/+0
| | | | | Support for StaticPointers was added in #12356 but I apparently neglected to remove the warning.
* Preserve specialisations despite CSESimon Peyton Jones2018-09-056-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trac #15445 showed that, as a result of CSE, a function with an automatically generated specialisation RULE could be inlined before the RULE had a chance to fire. This patch attaches a NOINLINE[2] activation to the Id, during CSE, to stop this happening. See Note [Delay inlining after CSE] ---- Historical note --- This patch is simpler and more direct than an earlier version: commit 2110738b280543698407924a16ac92b6d804dc36 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Mon Jul 30 13:43:56 2018 +0100 Don't inline functions with RULES too early We had to revert this patch because it made GHC itself slower. Why? It delayed inlining of /all/ functions with RULES, and that was very bad in TcFlatten.flatten_ty_con_app * It delayed inlining of liftM * That delayed the unravelling of the recursion in some dictionary bindings. * That delayed some eta expansion, leaving flatten_ty_con_app = \x y. let <stuff> in \z. blah * That allowed the float-out pass to put sguff between the \y and \z. * And that permanently stopped eta expasion of the function, even once <stuff> was simplified. -- End of historical note ---
* testsuite: Use bools for booleans, not intsBen Gamari2018-09-053-29/+29
| | | | | | | | | | | | | | Summary: Just as it says on the tin. Test Plan: Validate Reviewers: bgamari, osa1 Reviewed By: osa1 Subscribers: osa1, monoidal, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D5010
* testsuite: Add test for #15368Ben Gamari2018-09-053-0/+57
| | | | | | | | | | | | Reviewers: bgamari, osa1 Reviewed By: osa1 Subscribers: osa1, monoidal, rwbarton, thomie, carter GHC Trac Issues: #15368 Differential Revision: https://phabricator.haskell.org/D4958
* Skip eventlog tests in GHCi wayÖmer Sinan Ağacan2018-09-051-2/+2
| | | | | | | | | | | | | | | | | | Summary: (GHCi doesn't generate event logs) Test Plan: These tests were failing in GHCi way, they're now skipped in GHCi way as GHCi doesn't generate eventlogs Reviewers: bgamari, simonmar, maoe, alpmestan Reviewed By: alpmestan Subscribers: rwbarton, carter GHC Trac Issues: #15587 Differential Revision: https://phabricator.haskell.org/D5119
* Fix tests ghci057 and T9293. (#15071)roland2018-09-042-8/+0
| | | | | | | | | | | | | | | | | Summary: As both tests specify -fno-ghci-leak-check, the GHCi :set command is not expected to list the -fghci-leak check flag. Test Plan: WINDOWS: make test TESTS="ghci057 T9293" Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter GHC Trac Issues: #15071 Differential Revision: https://phabricator.haskell.org/D5125
* testsuite: make CHECK_API_ANNOTATIONS and CHECK_PPR overridableAlp Mestanogullari2018-09-041-1/+7
| | | | | | | | | | | | | | | | | | | | Summary: Without this patch, boilerplate.mk (which is included by a lot of Makefiles from our testsuite) just assumes they reside in the usual inplace directory, which is not friendly to hadrian and this makes a lot of tests (e.g T10255) fail when building GHC and running the testsuite with hadrian. With this patch, the said tests pass. Test Plan: api annotation tests (with hadrian) Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5127
* Add a test for Trac #15586Krzysztof Gogolewski2018-09-042-0/+13
| | | | | | | | | | | | | | | | Summary: The bug is already fixed in master. Test Plan: make test TEST=T15586 Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15586 Differential Revision: https://phabricator.haskell.org/D5118
* Compiler panic on invalid syntax (unterminated pragma)roland2018-09-042-1/+6
| | | | | | | | | | | | | | | | Summary: After a parse error in OPTIONS_GHC issue an error message instead of a compiler panic. Test Plan: make test TEST=T15053 Reviewers: Phyx, thomie, bgamari, monoidal, osa1 Reviewed By: Phyx, monoidal, osa1 Subscribers: tdammers, osa1, rwbarton, carter GHC Trac Issues: #15053 Differential Revision: https://phabricator.haskell.org/D5093
* canCFunEqCan: use isTcReflexiveCo (not isTcReflCo)Simon Peyton Jones2018-09-033-0/+93
| | | | | | | | | As Trac #15577 showed, it was possible for a /homo-kinded/ constraint to trigger the /hetero-kinded/ branch of canCFunEqCan, and that triggered an infinite loop. The fix is easier, but there remains a deeper questions: why is the flattener producing giant refexive coercions?
* Reject class instances with type families in kindsRyan Scott2018-09-028-15/+53
| | | | | | | | | | | | | | | | | | | | | Summary: GHC doesn't know how to handle type families that appear in class instances. Unfortunately, GHC didn't reject instances where type families appear in //kinds//, leading to #15515. This is easily rectified by calling `checkValidTypePat` on all arguments to a class in an instance (and not just the type arguments). Test Plan: make test TEST=T15515 Reviewers: bgamari, goldfire, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15515 Differential Revision: https://phabricator.haskell.org/D5068
* Remove knot-tying bug in TcHsSyn.zonkTyVarOccSimon Peyton Jones2018-08-314-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | There was a subtle knot-tying bug in TcHsSyn.zonkTyVarOcc, revealed in Trac #15552. I fixed it by * Eliminating the short-circuiting optimisation in zonkTyVarOcc, instead adding a finite map to get sharing of zonked unification variables. See Note [Sharing when zonking to Type] in TcHsSyn * On the way I /added/ the short-circuiting optimisation to TcMType.zonkTcTyVar, which has no such problem. This turned out (based on non-systematic measurements) to be a modest win. See Note [Sharing in zonking] in TcMType On the way I renamed some of the functions in TcHsSyn: * Ones ending in "X" (like zonkTcTypeToTypeX) take a ZonkEnv * Ones that do not end in "x" (like zonkTcTypeToType), don't. Instead they whiz up an empty ZonkEnv.
* Rename kind vars in left-to-right order in bindHsQTyVarsRyan Scott2018-08-288-4/+18
| | | | | | | | | | | | | | | | | | | | Summary: When renaming kind variables in an `LHsQTyVars`, we were erroneously putting all of the kind variables in the binders //after// the kind variables in the body, resulting in #15568. The fix is simple: just swap the order of these two around. Test Plan: make test TEST=T15568 Reviewers: simonpj, bgamari, goldfire Reviewed By: goldfire Subscribers: goldfire, rwbarton, carter GHC Trac Issues: #15568 Differential Revision: https://phabricator.haskell.org/D5108
* Fix #15572 by checking for promoted names in ConTRyan Scott2018-08-283-0/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: When converting `ConT`s to `HsTyVar`s in `Convert`, we were failing to account for the possibility of promoted data constructor names appearing in a `ConT`, which could result in improper pretty-printing results (as observed in #15572). The fix is straightforward: use `Promoted` instead of `NotPromoted` when the name of a `ConT` is a data constructor name. Test Plan: make test TEST=T15572 Reviewers: goldfire, bgamari, simonpj, monoidal Reviewed By: goldfire, simonpj Subscribers: monoidal, rwbarton, carter GHC Trac Issues: #15572 Differential Revision: https://phabricator.haskell.org/D5112
* Don't reify redundant class method tyvars/contextsRyan Scott2018-08-274-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, reifying classes produces class methods with redundant tyvars and class contexts in their type signatures, such as in the following: ```lang=haskell class C a where method :: forall a. C a => a ``` Fixing this is very straightforward: just apply `tcSplitMethodTy` to the type of each class method to lop off the redundant parts. It's possible that this could break some TH code in the wild that assumes the existence of these tyvars and class contexts, so I'll advertise this change in the release notes just to be safe. Test Plan: make test TEST="TH_reifyDecl1 T9064 T10891 T14888" Reviewers: goldfire, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15551 Differential Revision: https://phabricator.haskell.org/D5088
* Take strict fields into account in coverage checkingRyan Scott2018-08-274-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current pattern-match coverage checker implements the formalism presented in the //GADTs Meet Their Match// paper in a fairly faithful matter. However, it was discovered recently that there is a class of unreachable patterns that //GADTs Meet Their Match// does not handle: unreachable code due to strict argument types, as demonstrated in #15305. This patch therefore goes off-script a little and implements an extension to the formalism presented in the paper to handle this case. Essentially, when determining if each constructor can be matched on, GHC checks if its associated term and type constraints are satisfiable. This patch introduces a new form of constraint, `NonVoid(ty)`, and checks if each constructor's strict argument types satisfy `NonVoid`. If any of them do not, then that constructor is deemed uninhabitable, and thus cannot be matched on. For the full story of how this works, see `Note [Extensions to GADTs Meet Their Match]`. Along the way, I did a little bit of much-needed refactoring. In particular, several functions in `Check` were passing a triple of `(ValAbs, ComplexEq, Bag EvVar)` around to represent a constructor and its constraints. Now that we're adding yet another form of constraint to the mix, I thought it appropriate to turn this into a proper data type, which I call `InhabitationCandidate`. Test Plan: make test TEST=T15305 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15305 Differential Revision: https://phabricator.haskell.org/D5087
* Fix #15502 by not casting to Int during TH conversionRyan Scott2018-08-273-0/+14
| | | | | | | | | | | | | | | | | | | | | | | Summary: When turning an `IntegerL` to an `IntegralLit` during TH conversion, we were stupidly casting an `Integer` to an `Int` in order to determine how it should be pretty-printed. Unsurprisingly, this causes problems when the `Integer` doesn't lie within the bounds of an `Int`, as demonstrated in #15502. The fix is simple: don't cast to an `Int`. Test Plan: make test TEST=T15502 Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15502 Differential Revision: https://phabricator.haskell.org/D5089
* Fix #15550 by quoting RULE names during TH conversionRyan Scott2018-08-273-0/+20
| | | | | | | | | | | | | | | | | | | Summary: When converting a `RuleP` to a GHC source `RuleD` during TH conversion, we were stupidly not double-quoting the name of the rule. Easily fixed. Test Plan: make test TEST=T15550 Reviewers: goldfire, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15550 Differential Revision: https://phabricator.haskell.org/D5090
* Better error reporting for inaccessible codeSimon Peyton Jones2018-08-247-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes Trac #15558. There turned out to be two distinct problems * In TcExpr.tc_poly_expr_nc we had tc_poly_expr_nc (L loc expr) res_ty = do { traceTc "tcPolyExprNC" (ppr res_ty) ; (wrap, expr') <- tcSkolemiseET GenSigCtxt res_ty $ \ res_ty -> setSrcSpan loc $ -- NB: setSrcSpan *after* skolemising, -- so we get better skolem locations tcExpr expr res_ty Putting the setSrcSpan inside the tcSkolemise means that the location on the Implication constraint is the /call/ to the function rather than the /argument/ to the call, and that is really quite wrong. I don't know what Richard's comment NB means -- I moved the setSrcSpan outside, and the "binding site" info in error messages actually improved. The reason I found this is that it affects the span reported for Trac #15558. * In TcErrors.mkGivenErrorReporter we carefully munge the location for an insoluble Given constraint (Note [Inaccessible code]). But the 'implic' passed in wasn't necesarily the immediately- enclosing implication -- but for location-munging purposes it jolly well should be. Solution: use the innermost implication. This actually simplifies the code -- no need to pass an implication in to mkGivenErrorReporter.
* Clean up TcHsSyn.zonkEnvSimon Peyton Jones2018-08-247-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Triggered by Trac #15552, I'd been looking at ZonkEnv in TcHsSyn. This patch does some minor refactoring * Make ZonkEnv into a record with named fields, and use them. (I'm planning to add a new field, for TyCons, so this prepares the way.) * Replace UnboundTyVarZonker (a higer order function) with the simpler and more self-descriptive ZonkFlexi data type, below. It's just much more perspicuous and direct, and (I suspect) a tiny bit faster too -- no unknown function calls. data ZonkFlexi -- See Note [Un-unified unification variables] = DefaultFlexi -- Default unbound unificaiton variables to Any | SkolemiseFlexi -- Skolemise unbound unification variables -- See Note [Zonking the LHS of a RULE] | RuntimeUnkFlexi -- Used in the GHCi debugger There was one knock-on effect in the GHCi debugger -- the RuntimeUnkFlexi case. Somehow previously, these RuntimeUnk variables were sometimes getting SystemNames (and hence printed as 'a0', 'a1', etc) and sometimes not (and hence printed as 'a', 'b' etc). I'm not sure precisely why, but the new behaviour seems more uniform, so I just accepted the (small) renaming wibbles in some ghci.debugger tests. I had a quick look at perf: any changes are tiny.
* Accommodate API change in transSuperClassesSimon Peyton Jones2018-08-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | In this patch commit 6eabb6ddb7c53784792ee26b1e0657bde7eee7fb Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Tue Dec 15 14:26:13 2015 +0000 Allow recursive (undecidable) superclasses I changed (transSuperClasses p) to return only the superclasses of p, but not p itself. (Previously it always returned p as well.) The use of transSuperClasses in TcErrors.warnRedundantConstraints really needs 'p' in the result -- but I faild to fix this call site, and instead crippled the test for Trac #10100. This patch sets things right * Accomodates the API change * Re-enables T10100 * And thereby fixes Trac #11474
* Fix a typo in TcValidity.checkFamInstRhsSimon Peyton Jones2018-08-232-1/+9
| | | | | | | | | | | | | | | | | | | | | In error message generation we were using the wrong type constructor in inst_head. Result: the type became ill-kinded, and that sent the compiler into a loop. A separate patch fixes the loop. This patch fixes the actual bug -- Trac #15473. I also improved the "occurs more often" error message a bit. But it's still pretty terrible: * Variable ‘a’ occurs more often in the type family application ‘Undefined’ than in the instance head ‘LetInterleave xs t ts is y z’ It looks like nonsense, but all becomes clear if you use -fprint-explicit-kinds. Really we should fix this by spotting when invisible arguments are involved and at least suggesting -fprint-explicit-kinds.
* Add traceBinaryEvent# primopMitsutoshi Aoe2018-08-215-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new primop called traceBinaryEvent# that takes the length of binary data and a pointer to the data, then emits it to the eventlog. There is some example code that uses this primop and the new event: * [traceBinaryEventIO][1] that calls `traceBinaryEvent#` * [A patch to ghc-events][2] that parses the new `EVENT_USER_BINARY_MSG` There's no corresponding issue on Trac but it was discussed at ghc-devs [3]. [1] https://github.com/maoe/ghc-trace-events/blob /fb226011ef1f85a97b4da7cc9d5f98f9fe6316ae/src/Debug/Trace/Binary.hs#L29) [2] https://github.com/maoe/ghc-events/commit /239ca77c24d18cdd10d6d85a0aef98e4a7c56ae6) [3] https://mail.haskell.org/pipermail/ghc-devs/2018-May/015791.html Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D5007
* Correct limb length and assertion for gcdExtIntegerDavidEichamnn2018-08-212-0/+33
| | | | | | | | | | | | Reviewers: hvr, bgamari, monoidal Reviewed By: monoidal Subscribers: monoidal, rwbarton, thomie, carter GHC Trac Issues: #15350 Differential Revision: https://phabricator.haskell.org/D5042
* Show -with-rtsopts options in runtime's --info (#15261)roland2018-08-216-0/+19
| | | | | | | | | | | | | | | | | | Add an additional line to the output of +RTS --info. It shows the value of the flag -with-rtsopts provided at compile/link time. Test Plan: make test TESTS="T15261a T15261b" Reviewers: hvr, erikd, dfeuer, thomie, austin, bgamari, simonmar, osa1, monoidal Reviewed By: osa1, monoidal Subscribers: osa1, rwbarton, carter GHC Trac Issues: #15261 Differential Revision: https://phabricator.haskell.org/D5053
* base: Mark `findIndices` as INLINABLE instead of INLINE (fixes #15426)Kevin Buhr2018-08-212-0/+22
| | | | | | | | | | | | | | | | | | | | If `findIndices` is marked INLINE in `Data.OldList`, then the unfolded versions of `elemIndex` and `findIndex` included in the interface file are unfusible (even though `findIndices` itself remains fusible). By marking it INLINABLE instead, elemIndex` and `findIndex` will fuse properly. Test Plan: make TEST=T15426 Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15426 Differential Revision: https://phabricator.haskell.org/D5063
* testsuite: Deduplicate source in wcompat-warnings testBen Gamari2018-08-217-101/+44
|
* Introduce flag -keep-hscpp-filesroland2018-08-214-0/+26
| | | | | | | | | | | | | | Test Plan: `make test=T10869` Reviewers: mpickering, thomie, ezyang, bgamari Reviewed By: thomie, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #10869 Differential Revision: https://phabricator.haskell.org/D4861
* Fix #line pragmas in nested commentsBen Sklaroff2018-08-215-14/+57
| | | | | | | | | | | | | | | | | | | | | When parsing a nested comment or nested doc comment in the lexer, if we see a line starting with '#' we attempt to parse a #line pragma. This fixes how ghc handles output of the C preproccesor (-cpp flag) when the original source has C comments or pragmas inside haskell comments. Updates haddock submodule. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #314 Differential Revision: https://phabricator.haskell.org/D4934
* Improve ambiguous-occurrence error messageSimon Peyton Jones2018-08-216-13/+32
| | | | | | | | | | | | Trac #15487 correctly reported that the qualification of a Name in an ambiguous-occurrence error message was wrong. This patch fixes it. It's easily done, in RnUtils.addNameClashErrRn The problem was that in complaining about M.x we must enusre that 'M' part is the same as that used in pprNameProvenance.
* Set strictness correctly for JoinIdsSimon Peyton Jones2018-08-213-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | We were failing to keep correct strictness info when eta-expanding join points; Trac #15517. The situation was something like \q v eta -> let j x = error "blah -- STR Lx bottoming! in case y of A -> j x eta B -> blah C -> j x eta So we spot j as a join point and eta-expand it. But we must also adjust the stricness info, else it vlaimes to bottom after one arg is applied but now it has become two. I fixed this in two places: - In CoreOpt.joinPointBinding_maybe, adjust strictness info - In SimplUtils.tryEtaExpandRhs, return consistent values for arity and bottom-ness
* Initialise cec_suppress properlySimon Peyton Jones2018-08-206-74/+22
| | | | | | | | | | | In TcErrors, cec_suppress is used to suppress low-priority errors in favour of truly insoluble ones. But I was failing to initialise it correcly at top level, which resulted in Trac #15539. Easy to fix. A few regression tests have fewer errors reported, but that seems to be an improvement.
* CSE should deal with letrec (#9441)roland2018-08-185-16/+3
| | | | | | | | | | | | | | | | | Summary: Write tests with fewer lines. See comments of nomeata in https://phabricator.haskell.org/D5038. Test Plan: make test TESTS='T9441a T9441b T9441c' Reviewers: nomeata, dfeuer, bgamari Reviewed By: nomeata Subscribers: rwbarton, carter GHC Trac Issues: #9441 Differential Revision: https://phabricator.haskell.org/D5076
* Add test cases for Ticket #12146.Aditya2018-08-173-0/+10
| | | | Two tests - a ghci script and a compile fail test have been added.
* Be mindful of GADT tyvar order when desugaring record updatesRyan Scott2018-08-172-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After commit ef26182e2014b0a2a029ae466a4b121bf235e4e4, the type variable binders in GADT constructor type signatures are now quantified in toposorted order, instead of always having all the universals before all the existentials. Unfortunately, that commit forgot to update some code (which was assuming the latter scenario) in `DsExpr` which desugars record updates. This wound up being the cause of #15499. This patch makes up for lost time by desugaring record updates in a way such that the desugared expression applies type arguments to the right-hand side constructor in the correct order—that is, the order in which they were quantified by the user. Test Plan: make test TEST=T15499 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15499 Differential Revision: https://phabricator.haskell.org/D5060
* Rename SigTv to TyVarTv (#15480)Joachim Breitner2018-08-167-9/+9
| | | | | | | | | | | | | because since #15050, these are no longer used in pattern SIGnatures, but still in other places where meta-variables should only be unified with TYpe VARiables. I also found mentions of `SigTv` in parts of the renamer and desugarer that do not seem to directly relate to `SigTv` as used in the type checker, but rather to uses of `forall a.` in type signatures. I renamed these to `ScopedTv`. Differential Revision: https://phabricator.haskell.org/D5074
* Fix #15527 by pretty-printing an RdrName prefixlyRyan Scott2018-08-163-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When `(.) @Int` is used without enabling `TypeApplications`, the resulting error message will pretty-print the (symbolic) `RdrName` `(.)`. However, it does so without parenthesizing it, which causes the pretty-printed expression to appear as `.@Int`. Yuck. Since the expression in a type application will always be prefix, we can fix this issue by using `pprPrefixOcc` instead of plain ol' `ppr`. Test Plan: make test TEST=T15527 Reviewers: bgamari, monoidal, simonpj Reviewed By: monoidal, simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15527 Differential Revision: https://phabricator.haskell.org/D5071
* Add a test for Trac #15523Krzysztof Gogolewski2018-08-153-0/+13
| | | | | | | | | | | | | | | | Summary: Fortunately the bug is not present in master. Test Plan: make test TEST=T15523 Reviewers: bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #15523 Differential Revision: https://phabricator.haskell.org/D5070
* Properly designate LambdaCase alts as CaseAlt in THRyan Scott2018-08-143-0/+19
| | | | | | | | | | | | | | | | | | | | | | Summary: When `\case` expressions are parsed normally, their alternatives are marked as `CaseAlt` (which means that they are pretty-printed without a `\` character in front of them, unlike for lambda expressions). However, `\case` expressions created by way of Template Haskell (in `Convert`) inconsistently designated the case alternatives as `LambdaExpr`, causing them to be pretty-printed poorly (as shown in #15518). The fix is simple: use `CaseAlt` consistently. Test Plan: make test TEST=T15518 Reviewers: goldfire, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15518 Differential Revision: https://phabricator.haskell.org/D5069
* Suppress redundant givens during error reportingRyan Scott2018-08-124-1/+58
| | | | | | | | | | | | | | | | | | | Summary: When GHC reports that it cannot solve a constraint in error messages, it often reports what given constraints it has in scope. Unfortunately, sometimes redundant constraints (like `* ~ *`, from #15361) can sneak in. The fix is simple: blast away these redundant constraints using `mkMinimalBySCs`. Test Plan: make test TEST=T15361 Reviewers: simonpj, bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15361 Differential Revision: https://phabricator.haskell.org/D5002
* Check if files are same in combineSrcSpansZubin Duggal2018-08-124-0/+25
| | | | | | | | | | | | | | | | Summary: If this is not checked, SrcSpans are sometimes mangled by CPP. Test Plan: ./validate Reviewers: bgamari, dfeuer Reviewed By: bgamari Subscribers: dfeuer, rwbarton, thomie, carter GHC Trac Issues: #15279 Differential Revision: https://phabricator.haskell.org/D4866
* --show-iface: Qualify all non-local namesSimon Jakobi2018-08-123-9/+9
| | | | | | | | | | | | | | | | | | | | Summary: In order to disambiguate names from different modules, qualify all names that don't originate in the current module. Also update docs for QueryQualifyName Test Plan: validate Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, thomie, carter, tdammers GHC Trac Issues: #15269 Differential Revision: https://phabricator.haskell.org/D4852
* CSE should deal with letrecroland2018-08-128-1/+57
| | | | | | | | | | | | | | | | Summary: Add testcase for #9441 Test Plan: make test TESTS="T9441a T9441b T9441c" Reviewers: dfeuer, simonpj, thomie, austin, bgamari Reviewed By: dfeuer Subscribers: rwbarton, carter GHC Trac Issues: #9441 Differential Revision: https://phabricator.haskell.org/D5038
* Simplify testsuite driver, part 2Krzysztof Gogolewski2018-08-126-38/+37
| | | | | | | | | | | | | | | | | | Summary: - Avoid import *; this helps tools such as pyflakes. The last occurrence in runtests.py is not easy to remove as it's used by .T files. - Use False/True instead of 0/1. Test Plan: validate Reviewers: bgamari, thomie, simonmar Reviewed By: thomie Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5062
* Simplify testsuite driverKrzysztof Gogolewski2018-08-117-26/+10
| | | | | | | | | | | | | | | | | | | Summary: - remove clean_cmd - framework_failures was undefined - times_file was not used - if_verbose_dump was called only when verbose >= 1; remove the check - simplify normalise_whitespace Test Plan: validate Reviewers: bgamari, thomie Reviewed By: thomie Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5061
* Filter plugin dylib locationsChristiaan Baaij2018-08-114-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we just created a cartesian product of the library paths of the plugin package and the libraries of the package. Of course, some of these combinations result in a filepath of a file doesn't exists, leading to #15475. Instead of making `haskFile` return Nothing in case a file doesn't exist (which would hide errors), we look at all the possible dylib locations and ensure that at least one of those locations is an existing file. If the list turns out to be empty however, we panic. Reviewers: mpickering, bgamari Reviewed By: mpickering Subscribers: monoidal, rwbarton, carter GHC Trac Issues: #15475 Differential Revision: https://phabricator.haskell.org/D5048
* testsuite: Add (broken) test for #15473Ben Gamari2018-08-072-0/+13
|
* Turn on MonadFail desugaring by defaultHerbert Valerio Riedel2018-08-0711-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This contains two commits: ---- Make GHC's code-base compatible w/ `MonadFail` There were a couple of use-sites which implicitly used pattern-matches in `do`-notation even though the underlying `Monad` didn't explicitly support `fail` This refactoring turns those use-sites into explicit case discrimations and adds an `MonadFail` instance for `UniqSM` (`UniqSM` was the worst offender so this has been postponed for a follow-up refactoring) --- Turn on MonadFail desugaring by default This finally implements the phase scheduled for GHC 8.6 according to https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail#Transitionalstrategy This also preserves some tests that assumed MonadFail desugaring to be active; all ghc boot libs were already made compatible with this `MonadFail` long ago, so no changes were needed there. Test Plan: Locally performed ./validate --fast Reviewers: bgamari, simonmar, jrtc27, RyanGlScott Reviewed By: bgamari Subscribers: bgamari, RyanGlScott, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D5028