1. 20 Sep, 2019 9 commits
  2. 19 Sep, 2019 9 commits
    • Ben Gamari's avatar
      testsuite: Add testcase for #17206 · 52173990
      Ben Gamari authored
    • Sebastian Graf's avatar
      Add a regression test for #11822 · 2a8867cf
      Sebastian Graf authored
      The particular test is already fixed, but the issue seems to have
      multiple different test cases lumped together.
    • Sebastian Graf's avatar
      Extract PmTypes module from PmExpr and PmOracle · baf47661
      Sebastian Graf authored
      Apparently ghc-lib-parser's API blew up because the newly induced cyclic
      dependency between TcRnTypes and PmOracle pulled in the other half of
      GHC into the relevant strongly-connected component.
      This patch arranges it so that PmTypes exposes mostly data type
      definitions and type class instances to be used within PmOracle, without
      importing the any of the possibly offending modules DsMonad, TcSimplify
      and FamInst.
    • Ben Gamari's avatar
      CoreUtils: Use mightBeUnliftedType in exprIsTopLevelBindable · 912afaf4
      Ben Gamari authored
      Also add reference from isUnliftedType to mightBeUnliftedType.
    • Richard Eisenberg's avatar
      Test #17077. · c675d08f
      Richard Eisenberg authored
    • Richard Eisenberg's avatar
      Use level numbers for generalisation · f594a68a
      Richard Eisenberg authored
      This fixes #15809, and is covered in
      Note [Use level numbers for quantification] in TcMType.
      This patch removes the "global tyvars" from the
      environment, a nice little win.
    • Richard Eisenberg's avatar
      Refactor kindGeneralize and friends · d9c6b86e
      Richard Eisenberg authored
      This commit should have no change in behavior.(*)
      The observation was that Note [Recipe for checking a signature]
      says that every metavariable in a type-checked type must either
        (A) be generalized
        (B) be promoted
        (C) be zapped.
      Yet the code paths for doing these were all somewhat separate.
      This led to some steps being skipped. This commit shores this
      all up. The key innovation is TcHsType.kindGeneralizeSome, with
      appropriate commentary.
      This commit also sets the stage for #15809, by turning the
      WARNing about bad level-numbers in generalisation into an
      ASSERTion. The actual fix for #15809 will be in a separate
      Other changes:
       * zonkPromoteType is now replaced by kindGeneralizeNone.
         This might have a small performance degradation, because
         zonkPromoteType zonked and promoted all at once. The new
         code path promotes first, and then zonks.
       * A call to kindGeneralizeNone was added in tcHsPartialSigType.
         I think this was a lurking bug, because it did not follow
         Note [Recipe for checking a signature]. I did not try to
         come up with an example showing the bug. This is the (*)
         Because of this change, there is an error message regression
         in partial-sigs/should_fail/T14040a. This problem isn't really
         a direct result of this refactoring, but is a symptom of
         something deeper. See #16775, which addresses the deeper
       * I added a short-cut to quantifyTyVars, in case there's
         nothing to quantify.
       * There was a horribly-outdated Note that wasn't referred
         to. Gone now.
       * While poking around with T14040a, I discovered a small
         mistake in the Coercion.simplifyArgsWorker. Easy to fix,
       * See new Note [Free vars in coercion hole] in TcMType.
         Previously, we were doing the wrong thing when looking
         at a coercion hole in the gather-candidates algorithm.
         Fixed now, with lengthy explanation.
      Metric Decrease:
    • Ben Gamari's avatar
      Simplify: Lazy pattern match · de1723b2
      Ben Gamari authored
    • Simon Peyton Jones's avatar
      Add a missing update of sc_hole_ty (#16312) · c3eaaca6
      Simon Peyton Jones authored
      In simplCast I totally failed to keep the sc_hole_ty field of
      ApplyToTy (see Note [The hole type in ApplyToTy]) up to date.
      When a cast goes by, of course the hole type changes.
      Amazingly this has not bitten us before, but #16312 finally
      triggered it.  Fortunately the fix is simple.
      Fixes #16312.
  3. 17 Sep, 2019 5 commits
  4. 16 Sep, 2019 4 commits
    • Sebastian Graf's avatar
      Encode shape information in `PmOracle` · 7915afc6
      Sebastian Graf authored
      Previously, we had an elaborate mechanism for selecting the warnings to
      generate in the presence of different `COMPLETE` matching groups that,
      albeit finely-tuned, produced wrong results from an end user's
      perspective in some cases (#13363).
      The underlying issue is that at the point where the `ConVar` case has to
      commit to a particular `COMPLETE` group, there's not enough information
      to do so and the status quo was to just enumerate all possible complete
      sets nondeterministically.  The `getResult` function would then pick the
      outcome according to metrics defined in accordance to the user's guide.
      But crucially, it lacked knowledge about the order in which affected
      clauses appear, leading to the surprising behavior in #13363.
      In !1010 we taught the term oracle to reason about literal values a
      variable can certainly not take on. This MR extends that idea to
      `ConLike`s and thereby fixes #13363: Instead of committing to a
      particular `COMPLETE` group in the `ConVar` case, we now split off the
      matching constructor incrementally and record the newly covered case as
      a refutable shape in the oracle. Whenever the set of refutable shapes
      covers any `COMPLETE` set, the oracle recognises vacuosity of the
      uncovered set.
      This patch goes a step further: Since at this point the information
      in value abstractions is merely a cut down representation of what the
      oracle knows, value abstractions degenerate to a single `Id`, the
      semantics of which is determined by the oracle state `Delta`.
      Value vectors become lists of `[Id]` given meaning to by a single
      `Delta`, value set abstractions (of which the uncovered set is an
      instance) correspond to a union of `Delta`s which instantiate the
      same `[Id]` (akin to models of formula).
      Fixes #11528 #13021, #13363, #13965, #14059, #14253, #14851, #15753, #17096, #17149
      Metric Decrease:
    • Sylvain Henry's avatar
    • Sylvain Henry's avatar
      Fix Hadrian build with Stack (#17189) · 7208160d
      Sylvain Henry authored
      Broken by 2b37a79d
    • Ben Gamari's avatar
      Rename GHC.StgToCmm.Con -> GHC.StgToCmm.DataCon · cf7e78a3
      Ben Gamari authored
      Incredibly, Windows disallows the manipulation of any file matching
      Con(\..*)?. The `GHC.StgToCmm.Con` was introduced in the renamings in
      447864a9, breaking the Windows build. Work around this by renaming it to
      Fixes #17187.
  5. 14 Sep, 2019 1 commit
  6. 13 Sep, 2019 10 commits
  7. 12 Sep, 2019 2 commits
    • Ningning Xie's avatar
      Fix StandaloneDeriving · 86753475
      Ningning Xie authored
      If I understand correctly, `deriving instance _ => Eq (Foo a)`
      is equivalent to `data Foo a deriving Eq`, rather than
      `data Foo a deriving Foo`.
    • Sebastian Graf's avatar
      Bump Cabal submodule to 3.1 · 2b37a79d
      Sebastian Graf authored
      Metric Increase: