summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix #11246.Richard Eisenberg2016-02-173-38/+66
| | | | | | | We have to instantiate any invisible arguments to type families right away. This is now done in tcTyCon in TcHsType. testcase: typecheck/should_compile/T11246
* Fix #11241.Richard Eisenberg2016-02-171-1/+8
| | | | | | | When renaming a type, now looks for wildcards in bound variables' kinds. testcase: dependent/should_compile/T11241
* Use CoercionN and friends in TyCoRepRichard Eisenberg2016-02-172-20/+21
|
* Add missing kind cast to pure unifier.Richard Eisenberg2016-02-171-1/+1
|
* Existentials should be specified.Richard Eisenberg2016-02-171-1/+1
| | | | This addresses point (2) from #11513.
* Make exactTyCoVarsOfTypes closed over kinds.Richard Eisenberg2016-02-171-1/+1
|
* Small refactor and commentsSimon Peyton Jones2016-02-171-9/+25
| | | | Related to the fix to Trac #9611
* Simplify the defn of coreViewOneStarKindSimon Peyton Jones2016-02-171-6/+5
| | | | | I discussed it with Richard, but this version is much simmpler and more efficient.
* Comments onlySimon Peyton Jones2016-02-171-1/+1
|
* DynFlags: Don't panic on incompatible Safe Haskell flagsBen Gamari2016-02-161-1/+1
| | | | | | | | | | | | | | | | | We just return an arbitrary value since we are destined to fail due to the error anyways. Fixes #11580. Test Plan: Needs to be tested Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1925 GHC Trac Issues: #11580
* Suggest candidate instances in error messageYuras Shumovich2016-02-161-5/+24
| | | | | | | | | | | | | | | | | | See Trac #9611. In "No instance..." error message we suggest instances for other types with the same occ name. It is usefull e.g. when we have two different versions of the same package installed. Test Plan: typecheck/should_fail/tcfail224 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1919 GHC Trac Issues: #9611
* Fix typosRik Steenkamp2016-02-1610-25/+25
| | | | | | | | | | Reviewers: bgamari, austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1915
* Fix two wrong uses of "data constructor" in error msgsRik Steenkamp2016-02-163-9/+15
| | | | | | | | | | | | | | | | | | | Replace `NoDataKinds :: PromotionErr` by `NoDataKindsTC` and `NoDataKindsDC` (just like there is `NoTypeInTypeTC` and `NoTypeInTypeDC`). This allows for a correct error message when a kind signature contains a type constructor and `-XDataKinds` is not specified. Apply a small fix to `TcError.hs` where instead of "data constructor" we should say "pattern synonym". Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1909
* Improved error message about exported type operators.Ulya Trofimovich2016-02-162-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is ambiguty between (1) type constructors and (2) data constructors in export lists, e.g. '%%' can stand for both of them. This ambiguity is resolved in favor of (2). If the exported data constructor is not in scope, but type constructor with the same name is in scope, GHC should suggest adding 'type' keyword to resolve ambiguity in favor of (1) and enabling 'TypeOperators' extension. The patch only extends the error message. See Trac #11432. Test Plan: `make test` Reviewers: simonpj, bgamari, austin Reviewed By: simonpj Subscribers: mpickering, thomie, goldfire, kosmikus Differential Revision: https://phabricator.haskell.org/D1902 GHC Trac Issues: #11432
* Rename missing-pat-syn-sigs to missing-pat-syn-signaturesMatthew Pickering2016-02-151-1/+1
|
* A tiny, outright bug in tcDataFamInstDeclSimon Peyton Jones2016-02-153-13/+20
| | | | | | | | | | | | | | This bug was revealed by Trac #11362. It turns out that in my patch for Trac #11148 (namely 1160dc5), I failed to turn one occurrence of tvs' into full_tvs. Sigh. This is tricky stuff and it cost me several hours to page it back in and figure out what was happening. The result was a CoAxiom whose lhs had rhs had different kinds. Eeek! Anyway it's fixed. I also added an ASSERT, in FamInst.newFamInst, that trips on such bogus CoAxioms.
* Comments and white spaceSimon Peyton Jones2016-02-151-2/+7
|
* Tiny refactor; use guards instead of 'if'Simon Peyton Jones2016-02-151-7/+7
|
* Comments onlySimon Peyton Jones2016-02-152-6/+19
|
* Improve error message suppressionSimon Peyton Jones2016-02-151-7/+12
| | | | | | | | | 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
* renamer discards name location for HsRecFieldAlan Zimmerman2016-02-141-2/+3
| | | | | | | When renaming a HsVar it can be converted to a HsRecField. In the process the location of the enclosed name is converted to a noLoc Closes #11576
* Minor refactoring to tauifyMultipleMatchesSimon Peyton Jones2016-02-122-16/+15
| | | | No change in behaviour
* Improve pretty-printing of HsWrappersSimon Peyton Jones2016-02-125-50/+60
| | | | | | | | Reduces un-neede parens. Also -fprint-typechecker-elaboration now makes type applications and casts in expressions also appear. (Previously those were confusingly controlled by -fprint-explicit-coercions.)
* Simplify AbsBinds wrappingSimon Peyton Jones2016-02-126-251/+185
| | | | | | | | | | | | | | | | | | | | | | In poking Trac #11414 I found myself sinking into the abe_inst_wrap swamp. What is this strange thing? (It turned out that #11414 was breaking because of it.) Thrillingly, I found a way to sweep it away again, putting the deep instantation into tcMonoBinds instead of mkExport; and it turned out that the fun_co_fn field of FunBind was already there ready to receive exactly this wrapper. Hooray. Result * Death to abe_inst_wrap * Death to mbi_orig * Death to the plumbing in tcPolyInfer that did the deep instantiation I did find that I had to re-engineer the treatment of instance type signatures (again), but the result looks more modular and robust to me. And #11414 is fixed.
* Revert "Build the substitution correctly in piResultTy"Bartosz Nitka2016-02-121-20/+6
| | | | | | | | | | | | | This reverts commit dbf72dbc6e49b3db7f2337a7a41e95c1d0169163. This commit introduced performance regressions: https://ghc.haskell.org/trac/ghc/ticket/11371#comment:27, I will push it again after I fix it. Test Plan: revert Reviewers: simonpj, bgamari, simonmar, austin, goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1907
* Revert "sizeExpr: fix a bug in the size calculation"Simon Marlow2016-02-121-15/+3
| | | | This reverts commit 51a33924fc118d9b6c1db556c75c0d010ef95e18.
* Build the substitution correctly in piResultTyBartosz Nitka2016-02-111-6/+20
| | | | | | | | | | | | | | | | | | This fixes a bug where piResultTy created substitutions that would violate both of the invariants in Note [The substitution invariant]. Test Plan: ./validate --slow Reviewers: goldfire, simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: simonmar, thomie Differential Revision: https://phabricator.haskell.org/D1855 GHC Trac Issues: #11371
* Another batch of typo fixes in non-codeGabor Greif2016-02-1110-10/+10
|
* compiler: Do not suggest nor complete deprecated flags fix trac issue #11454Nikita Kartashov2016-02-111-545/+772
| | | | | | | | | | | | | | Previously, all flags were present in user suggest and completion. This commit removes the deprecated ones from there. It is done by saving deprecation info at the moment of flag definition. Reviewers: rwbarton, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D1883
* sizeExpr: fix a bug in the size calculationSimon Marlow2016-02-111-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | There were two bugs here: * We weren't ignoring Cast in size_up_app * An application of a non-variable wasn't being charged correct The result was that some things looked too cheap. In my case I had things like ((f x) `cast` ...) y which was given size 21 instead of 30, and this had knock-on effects elsewhere that caused some large code bloat. Test Plan: * nofib runs (todo) * validate Reviewers: simonpj, austin, bgamari, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1900 GHC Trac Issues: #11564
* Comments about ru_autoSimon Peyton Jones2016-02-112-13/+16
| | | | ...following a question from Conal
* Always do eta-reductionSimon Peyton Jones2016-02-111-1/+16
| | | | | | | See Note [Eta-reduction in -O0] in DynFlags. Bottom line: doing eta reduction unconditionally is benign, and removes an ASSERT failure (Trac #11562).
* Replace mkTvSubstPrs (a `zip` b) with zipTvSubst a bBartosz Nitka2016-02-103-3/+3
| | | | | | | | | | | | | | | It's just a small cleanup. There should be no change in behaviour. Test Plan: ./validate --slow Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D1901
* Wrap solveEqualities in checkNoErrsSimon Peyton Jones2016-02-102-8/+22
| | | | | | | | | This simple change fixes Trac #11563, #11520, #11516, #11399. See esp the comments in #11520. See Note [Fail fast on kind errors] in TcSimplify Merge to 8.0 branch
* DynFlags: drop tracking of '-#include' flagsSergei Trofimovich2016-02-091-7/+1
| | | | | | | GHC does not use passed paramaters anywhere for this deprecated option. Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* TcPatSyn: Fix spelling of "pattern" in error messageBen Gamari2016-02-091-1/+1
|
* TcErrors: Fix plural form of "instance" errorBen Gamari2016-02-091-2/+2
| | | | | | | | | Previously "types" was inappropriately made plural instead of "instance", instance Eq Ordering -- Defined in ‘GHC.Classes’ ...plus 24 others ...plus 13 instance involving out-of-scope typess
* Fix the removal of unnecessary stack checksJonas Scholl2016-02-091-6/+21
| | | | | | | | | | | | | | | | | | | | The module CmmLayoutStack removes stack checks if a function does not use stack space. However, it can only recognize checks of the form Sp < SpLim. However, these checks get sometimes rewritten to Sp >= SpLim (with both branches swapped), so we better recognize these checks too. Test Plan: ./validate Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1881 GHC Trac Issues: #11533
* Print * has Unicode star with -fprint-unicode-syntaxBen Gamari2016-02-093-2/+7
| | | | | | | | Reviewers: austin, thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1893
* Remove unused LiveVars and SRT fields of StgCaseÖmer Sinan Ağacan2016-02-0810-312/+164
| | | | | | | | | | | | | | | | | | | | | | | We also need to update `stgBindHasCafRefs` assertion with this change, as we no longer have the pre-computed SRT, LiveVars etc. We rename it to `topStgBindHasCafRefs` and implement it like this: A non-updatable top-level binding may refer to a CAF by referring to a top-level definition with CAFs. A top-level definition may have CAFs if it's updatable. At this point (because this is done after TidyPgm) top-level Ids (whether imported or defined in this module) are GlobalIds, so the top-levelness test is easy. (see also comments in the code) Reviewers: bgamari, simonpj, austin Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1889 GHC Trac Issues: #11550
* Define tyConRolesRepresentational and use itSimon Peyton Jones2016-02-083-10/+13
| | | | | | | | | | | tyConRolesRepresentational is just a version of tyConRolesX, but specialised for a Representational argument. Saves a bit of extra argument passing and pattern matching, and tyConRolesX was often called when we knew the argument role was Representational. Rather to my surprise this made the compiler allocate 5% less for tests T9872{b,c,d}. At least I think it's this commit. Good thing, regardless.
* Define mkTvSubst, and use itSimon Peyton Jones2016-02-087-28/+25
| | | | | mkTvSubst :: InScopeSet -> TvSubstEnv -> TCvSubst produces a TCvSubst with an empty CvSubstEnv
* Some tiding up in TcGenDerivSimon Peyton Jones2016-02-083-38/+91
| | | | | | | | ..around newtype deriving instances. See esp the new Note [Newtype-deriving instances] No change in behaviour
* Fix a nasty superclass expansion bugSimon Peyton Jones2016-02-082-62/+98
| | | | | | | | | | | | | | | | This patch fixes Trac #11523. * The basic problem was that TcRnTypes.superClassesMightHelp was returning True of a Derived constraint, and that led to us expanding Given superclasses, which produced the same Derived constraint again, and so on infinitely. We really want to do this only if there are unsolve /Wanted/ contraints! * On the way I made TcSMonad.getUnsolvedInerts a bit more discriminating about which Derived equalities it returns; see Note [Unsolved Derived equalities] in TcSMonad * Lots of new comments in TcSMonad.
* A small, local refactoring of TcSimplify.usefulToFloatSimon Peyton Jones2016-02-081-5/+5
|
* Use runTcSDeriveds for simplifyDefaultSimon Peyton Jones2016-02-081-4/+5
| | | | This is a small refactoring, no change in behaviour.
* Improve error messages for recursive superclassesSimon Peyton Jones2016-02-082-11/+22
| | | | | | | | If we fail to typecheck by blowing the constraint simplifier iteration limit, we want to see the limit-blowing meessage. Previously it was being suppressed by the type /error/, which suppress the iteration-limit /warning/. Solution: make the iteration-limit message into an error.
* Improve tracing in TcInteractSimon Peyton Jones2016-02-082-9/+19
|
* Comment out some traceFlat callsSimon Peyton Jones2016-02-081-8/+8
| | | | | They were excessively verbose. I've commented them out rather than deleting so that they can easily be restored.
* Document and improve superclass expansionSimon Peyton Jones2016-02-082-14/+34
| | | | | | | | When investigating Trac #11523 I found that superclass expansion was a little over-aggressive; we were sort of unrolling each loop twice. This patch corrects that, and adds explanatory comments.