Skip to content
Snippets Groups Projects
  1. Aug 10, 2018
  2. Aug 09, 2018
  3. Aug 08, 2018
  4. Aug 07, 2018
  5. Aug 06, 2018
  6. Aug 03, 2018
  7. Aug 02, 2018
    • Matthías Páll Gissurarson's avatar
      Clone relevant constraints to avoid side-effects on HoleDests. Fixes #15370. · 588364c3
      Matthías Páll Gissurarson authored and Ben Gamari's avatar Ben Gamari committed
      Summary: When looking for valid hole fits, the constraints relevant
      to the hole may sometimes contain a HoleDest. Previously,
      these were not cloned, which could cause the filling of filled
      coercion hole being, which would cause an assert to fail. This is now fixed.
      
      Test Plan: Regression test included.
      
      Reviewers: simonpj, bgamari, goldfire
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15370
      
      Differential Revision: https://phabricator.haskell.org/D5004
      
      (cherry picked from commit 0dc86f6b)
      588364c3
    • Christiaan Baaij's avatar
      Plugin dependency information is stored separately · e86db0d5
      Christiaan Baaij authored
      We need to store the used plugins so that we recompile
      a module when a plugin that it uses is recompiled.
      
      However, storing the `ModuleName`s of the plugins used by a
      module in the `dep_mods` field made the rest of GHC think
      that they belong in the HPT, causing at least the issues
      reported in #15234
      
      We therefor store the `ModuleName`s of the plugins in a
      new field, `dep_plgins`, which is only used the the
      recompilation logic.
      
      Reviewers: mpickering, bgamari
      
      Reviewed By: mpickering, bgamari
      
      Subscribers: alpmestan, rwbarton, thomie, carter
      
      GHC Trac Issues: #15234
      
      Differential Revision: https://phabricator.haskell.org/D4937
      
      (cherry picked from commit 52065e95)
      e86db0d5
    • Simon Peyton Jones's avatar
      Treat isConstraintKind more consistently · 6a7cb806
      Simon Peyton Jones authored
      It turned out that we were not being consistent
      about our use of isConstraintKind.
      
      It's delicate, because the typechecker treats Constraint and Type as
      /distinct/, whereas they are the /same/ in the rest of the compiler
      (Trac #11715).
      
      And had it wrong, which led to Trac #15412.  This patch does the
      following:
      
      * Rename isConstraintKind      to tcIsConstraintKind
               returnsConstraintKind to tcReturnsConstraintKind
        to emphasise that they use the 'tcView' view of types.
      
      * Move these functions, and some related ones (tcIsLiftedTypeKind),
        from Kind.hs, to group together in Type.hs, alongside isPredTy.
      
      It feels very unsatisfactory that these 'tcX' functions live in Type,
      but it happens because isPredTy is called later in the compiler
      too.  But it's a consequence of the 'Constraint vs Type' dilemma.
      
      (cherry picked from commit c5d31df7)
      6a7cb806
    • Ryan Scott's avatar
      Fix #15385 by using addDictsDs in matchGuards · e649085b
      Ryan Scott authored
      When coverage checking pattern-matches, we rely on the call
      sites in the desugarer to populate the local dictionaries and term
      evidence in scope using `addDictsDs` and `addTmCsDs`. But it turns
      out that only the call site for desugaring `case` expressions was
      actually doing this properly. In another part of the desugarer,
      `matchGuards` (which handles pattern guards), it did not update the
      local dictionaries in scope at all, leading to #15385.
      
      Fixing this is relatively straightforward: just augment the
      `BindStmt` case of `matchGuards` to use `addDictsDs` and `addTmCsDs`.
      Accomplishing this took a little bit of import/export tweaking:
      
      * We now need to export `collectEvVarsPat` from `HsPat.hs`.
      * To avoid an import cycle with `Check.hs`, I moved `isTrueLHsExpr`
        from `DsGRHSs.hs` to `DsUtils.hs`, which resides lower on the
        import chain.
      
      Test Plan: make test TEST=T15385
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15385
      
      Differential Revision: https://phabricator.haskell.org/D4968
      
      (cherry picked from commit 9d388eb8)
      e649085b
    • Simon Peyton Jones's avatar
      Small refactor in desugar of pattern matching · 42c51e2f
      Simon Peyton Jones authored
      In reviewing Phab:D4968 for Trac #15385 I saw a small
      but simple refactor to avoid unnecessary work in the
      desugarer.
      
      This patch just arranges to call
         matchSinglePatVar v ...
      rather than
         matchSinglePat (Var v) ...
      
      The more specialised function already existed, as
         match_single_pat_var
      
      I also added more comments about decideBangHood
      
      (cherry picked from commit 45cfe651)
      42c51e2f
    • Richard Eisenberg's avatar
      Remove the type-checking knot. · 59f38587
      Richard Eisenberg authored and Ben Gamari's avatar Ben Gamari committed
      Bug #15380 hangs because a knot-tied TyCon ended up in a kind.
      Looking at the code in tcInferApps, I'm amazed this hasn't happened
      before! I couldn't think of a good way to fix it (with dependent
      types, we can't really keep types out of kinds, after all), so
      I just went ahead and removed the knot.
      
      This was remarkably easy to do. In tcTyVar, when we find a TcTyCon,
      just use it. (Previously, we looked up the knot-tied TyCon and used
      that.) Then, during the final zonk, replace TcTyCons with the real,
      full-blooded TyCons in the global environment. It's all very easy.
      
      The new bit is explained in the existing
      Note [Type checking recursive type and class declarations]
      in TcTyClsDecls.
      
      Naturally, I removed various references to the knot and the
      zonkTcTypeInKnot (and related) functions. Now, we can print types
      during type checking with abandon!
      
      NB: There is a teensy error message regression with this patch,
      around the ordering of quantified type variables. This ordering
      problem is fixed (I believe) with the patch for #14880. The ordering
      affects only internal variables that cannot be instantiated with
      any kind of visible type application.
      
      There is also a teensy regression around the printing of types
      in TH splices. I think this is really a TH bug and will file
      separately.
      
      Test case: dependent/should_fail/T15380
      
      (cherry picked from commit f8618a9b)
      59f38587
    • Ben Gamari's avatar
      Bump Cabal submodule to 2.4 · ff086cc1
      Ben Gamari authored
      ff086cc1
  8. Aug 01, 2018
    • Ryan Scott's avatar
      Fix #15450 by refactoring checkEmptyCase' · ebd773a0
      Ryan Scott authored
      `checkEmptyCase'` (the code path for coverage-checking
      `EmptyCase` expressions) had a fair bit of code duplication from the
      code path for coverage-checking non-`EmptyCase` expressions, and to
      make things worse, it behaved subtly different in some respects (for
      instance, emitting different warnings under unsatisfiable
      constraints, as shown in #15450). This patch attempts to clean up
      both this discrepancy and the code duplication by doing the
      following:
      
      * Factor out a `pmInitialTmTyCs` function, which returns the initial
        set of term and type constraints to use when beginning coverage
        checking. If either set of constraints is unsatisfiable, we use an
        empty set in its place so that we can continue to emit as many
        warnings as possible. (The code path for non-`EmptyCase`
        expressions was doing this already, but not the code path for
        `EmptyCase` expressions, which is the root cause of #15450.)
      
        Along the way, I added a `Note` to explain why we do this.
      * Factor out a `pmIsSatisfiable` constraint which checks if a set of
        term and type constraints are satisfiable. This does not change any
        existing behavior; this is just for the sake of deduplicating code.
      
      Test Plan: make test TEST=T15450
      
      Reviewers: simonpj, bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15450
      
      Differential Revision: https://phabricator.haskell.org/D5017
      
      (cherry picked from commit 7f3cb50d)
      ebd773a0
    • Vladislav Zavialov's avatar
      Fix #15415 and simplify tcWildCardBinders · a97ead78
      Vladislav Zavialov authored and Ben Gamari's avatar Ben Gamari committed
      Test Plan: Validate
      
      Reviewers: goldfire, simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: RyanGlScott, rwbarton, thomie, carter
      
      GHC Trac Issues: #15415
      
      Differential Revision: https://phabricator.haskell.org/D5022
      
      (cherry picked from commit 120cc9f8)
      a97ead78
    • Moritz Angermann's avatar
      linker: Nub rpaths · c9be8596
      Moritz Angermann authored and Ben Gamari's avatar Ben Gamari committed
      When compiling and linking files in `ghci`, we keep adding rpath
      arguments to the linker command invoation.  If those are identical we
      should `nub` them out.  Otherwise we not only risk overflowing the
      argument limit, but also embed huge amounts of identical rpath values
      into the dynamic library, eventually leading to the overflow of the load
      command size limit, due to the number of rpath entries alone.
      
      A further improvement could be to pass `-Xlinker -dead_strip_dylibs`;
      that however might be stipping too aggressively, and potentially lead to
      missing symbols?
      
      For the time being I suggest to only do the nubbing and if need be to
      provide -Wl,-dead_strip_dylibs when invoking ghci.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, hvr
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15446
      
      Differential Revision: https://phabricator.haskell.org/D5021
      
      (cherry picked from commit b803c406)
      c9be8596
    • Ningning Xie's avatar
      Fix #15453: bug in ForAllCo case in opt_trans_rule · eb2b71c5
      Ningning Xie authored
      Summary:
      Given
      
      ```
      co1 = \/ tv1 : eta1. r1
      co2 = \/ tv2 : eta2. r2
      ```
      
      We would like to optimize `co1; co2` so we push transitivity inside forall.
      It should be
      
      ```
      \/tv1 : (eta1;eta2).  (r1; r2[tv2 |-> tv1 |> eta1])
      ```
      
      It is implemented in the ForAllCo case in opt_trans_rule in OptCoercion.
      However current implementation is not right:
      
      ```
      r2' = substCoWithUnchecked [tv2] [TyVarTy tv1] r2 -- ill-kinded!
      ```
      
      This patch corrects it to be
      
      ```
      r2' = substCoWithUnchecked [tv2] [mkCastTy (TyVarTy tv1) eta1] r2
      ```
      
      Test Plan: validate
      
      Reviewers: bgamari, goldfire, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15453
      
      Differential Revision: https://phabricator.haskell.org/D5018
      
      (cherry picked from commit 11de4380)
      eb2b71c5
    • Ben Gamari's avatar
      Enable two-step allocator on FreeBSD · 79e13610
      Ben Gamari authored
      Simplify #ifdef nesting and use MAP_GUARD on FreeBSD and similar
      systems. This allows the two-step allocator to be used on FreeBSD,
      fixing #15348.
      
      (cherry picked from commit 123aeb91)
      79e13610
  9. Jul 31, 2018
    • Richard Eisenberg's avatar
      testsuite: Add test for #15346 · f579162a
      Richard Eisenberg authored and Ben Gamari's avatar Ben Gamari committed
      Test case: dependent/should_compile/T{15346,15419}.
      f579162a
    • Ben Gamari's avatar
      Fix some casts. · 06c29ddc
      Ben Gamari authored
      This fixes #15346, and is a team effort between Ryan Scott and
      myself (mostly Ryan). We discovered two errors related to FC's
      "push" rules, one in the TPush rule (as implemented in pushCoTyArg)
      and one in KPush rule (it shows up in liftCoSubstVarBndr).
      
      The solution: do what the paper says, instead of whatever random
      thoughts popped into my head as I was actually implementing.
      
      Note that this is a backport of the fix merged to master,
      af624071.
      
      Also fixes #15419, which is actually the same underlying problem.
      
      Test case: dependent/should_compile/T{15346,15419}.
      06c29ddc
    • Sylvain Henry's avatar
      Fix Git commit ID detection in Git worktrees · 2a162eba
      Sylvain Henry authored
      Summary: When using a Git worktree, ".git" is a file, not a directory
      
      Reviewers: bgamari, monoidal
      
      Reviewed By: monoidal
      
      Subscribers: rwbarton, thomie, erikd, carter
      
      Differential Revision: https://phabricator.haskell.org/D5016
      
      (cherry picked from commit 3539561b)
      2a162eba
Loading