Skip to content
Snippets Groups Projects
  1. Jul 26, 2019
    • Ryan Scott's avatar
      Banish reportFloatingViaTvs to the shadow realm (#15831, #16181) · 30b6f391
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      GHC used to reject programs of this form:
      
      ```
      newtype Age = MkAge Int
        deriving Eq via Const Int a
      ```
      
      That's because an earlier implementation of `DerivingVia` would
      generate the following instance:
      
      ```
      instance Eq Age where
        (==) = coerce @(Const Int a -> Const Int a -> Bool)
                      @(Age         -> Age         -> Bool)
                      (==)
      ```
      
      Note that the `a` in `Const Int a` is not bound anywhere, which
      causes all sorts of issues. I figured that no one would ever want to
      write code like this anyway, so I simply banned "floating" `via` type
      variables like `a`, checking for their presence in the aptly named
      `reportFloatingViaTvs` function.
      
      `reportFloatingViaTvs` ended up being implemented in a subtly
      incorrect way, as #15831 demonstrates. Following counsel with the
      sage of gold fire, I decided to abandon `reportFloatingViaTvs`
      entirely and opt for a different approach that would _accept_
      the instance above. This is because GHC now generates this instance
      instead:
      
      ```
      instance forall a. Eq Age where
        (==) = coerce @(Const Int a -> Const Int a -> Bool)
                      @(Age         -> Age         -> Bool)
                      (==)
      ```
      
      Notice that we now explicitly quantify the `a` in
      `instance forall a. Eq Age`, so everything is peachy scoping-wise.
      See `Note [Floating `via` type variables]` in `TcDeriv` for the full
      scoop.
      
      A pleasant benefit of this refactoring is that it made it much easier
      to catch the problem observed in #16181, so this patch fixes that
      issue too.
      
      Fixes #15831. Fixes #16181.
      30b6f391
  2. Jul 23, 2019
  3. Jul 21, 2019
    • Roland Senn's avatar
      Fix #8487: Debugger confuses variables · 32be4461
      Roland Senn authored and Marge Bot's avatar Marge Bot committed
      To display the free variables for a single breakpoint, GHCi pulls out the
      information from the fields `modBreaks_breakInfo` and `modBreaks_vars`
      of the `ModBreaks` data structure. For a specific breakpoint this gives 2
      lists of types 'Id` (`Var`) and `OccName`. They are used to create the Id's
      for the free variables and must be kept in sync:
      If we remove an element from the Names list, then we also must remove the
      corresponding element from the OccNames list.
      32be4461
    • Ivan Kasatenko's avatar
      Do not ignore events deletion when events to be added are provided (#16916) · 67ee741b
      Ivan Kasatenko authored and Marge Bot's avatar Marge Bot committed
      Kqueue/kevent implementation used to ignore events to be unsubscribed
      from when events to be subscribed to were provided. This resulted in a
      lost notification subscription, when GHC runtime didn't listen for any
      events, yet the kernel considered otherwise and kept waking up the IO
      manager thread.
      
      This commit fixes this issue by always adding and removing all of the
      provided subscriptions.
      67ee741b
  4. Jul 20, 2019
  5. Jul 19, 2019
  6. Jul 16, 2019
  7. Jul 14, 2019
  8. Jul 12, 2019
    • Simon Peyton Jones's avatar
      Fix kind-checking for data/newtypes · e4c73514
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      In one spot in kcConDecl we were passing in the return
      kind signature rether than the return kind. e.g. #16828
      
         newtype instance Foo :: Type -> Type where
           MkFoo :: a -> Foo a
      
      We were giving kcConDecl the kind (Type -> Type), whereas it
      was expecting the ultimate return kind, namely Type.
      
      This "looking past arrows" was being done, independently,
      in several places, but we'd missed one.  This patch moves it all
      to one place -- the new function kcConDecls (note the plural).
      
      I also took the opportunity to rename
        tcDataFamHeader  to   tcDataFamInstHeader
      
      (The previous name was consistently a source of confusion.)
      e4c73514
  9. Jul 11, 2019
  10. Jul 10, 2019
    • Simon Peyton Jones's avatar
      Fix erroneous float in CoreOpt · d2e290d3
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      The simple optimiser was making an invalid transformation
      to join points -- yikes.  The fix is easy.
      
      I also added some documentation about the fact that GHC uses
      a slightly more restrictive version of join points than does
      the paper.
      
      Fix #16918
      d2e290d3
    • Eric Wolf's avatar
      T16804: adjust src spans · 8fcc931c
      Eric Wolf authored and Marge Bot's avatar Marge Bot committed
      8fcc931c
    • Eric Wolf's avatar
      Add testcase T16804 for #16804 · 85da17e5
      Eric Wolf authored and Marge Bot's avatar Marge Bot committed
      slightly larger testcase for :type-at and :uses
      so we can see changes, if #16804 is done.
      85da17e5
    • Ömer Sinan Ağacan's avatar
      Testsuite tweaks and refactoring · d7423f10
      Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
      - Rename requires_th to req_th for consistency with other req functions
        (e.g. req_interp, req_profiling etc.)
      
      - req_th (previously requires_th) now checks for interpreter (via
        req_interp). With this running TH tests are skipped when running the
        test suite with stage=1.
      
      - Test tweaks:
          - T9360a, T9360b: Use req_interp
          - recomp009, T13938, RAE_T32a: Use req_th
      
      - Fix check-makefiles linter: it now looks for Makefiles instead of .T
        files (which are actually Python files)
      d7423f10
    • Ben Gamari's avatar
      testsuite: Fix #16818 · 42ff8653
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Renames performance metrics to include whether they are compile-time or
      runtime metrics.
      42ff8653
    • Phuong Trinh's avatar
      Fix #16511: changes in interface dependencies should trigger recompilation · b05c8423
      Phuong Trinh authored and Marge Bot's avatar Marge Bot committed
      If the union of dependencies of imported modules change, the `mi_deps`
      field of the interface files should change as well. Because of that, we
      need to check for changes in this in recompilation checker which we are
      not doing right now. This adds a checks for that.
      b05c8423
  11. Jul 09, 2019
    • Ryan Scott's avatar
      Use an empty data type in TTG extension constructors (#15247) · 6a03d77b
      Ryan Scott authored
      To avoid having to `panic` any time a TTG extension constructor is
      consumed, this MR introduces an uninhabited 'NoExtCon' type and uses
      that in every extension constructor's type family instance where it
      is appropriate. This also introduces a 'noExtCon' function which
      eliminates a 'NoExtCon', much like 'Data.Void.absurd' eliminates
      a 'Void'.
      
      I also renamed the existing `NoExt` type to `NoExtField` to better
      distinguish it from `NoExtCon`. Unsurprisingly, there is a lot of
      code churn resulting from this.
      
      Bumps the Haddock submodule. Fixes #15247.
      6a03d77b
  12. Jul 08, 2019
  13. Jul 05, 2019
    • Alex D's avatar
      Fix #16895 by checking whether infix expression operator is a variable · 2fd1ed54
      Alex D authored and Marge Bot's avatar Marge Bot committed
      2fd1ed54
    • Ryan Scott's avatar
      More sensible SrcSpans for recursive pattern synonym errors (#16900) · 62b82135
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      Attach the `SrcSpan` of the first pattern synonym binding involved in
      the recursive group when throwing the corresponding error message,
      similarly to how it is done for type synonyms.
      
      Fixes #16900.
      62b82135
    • Simon Peyton Jones's avatar
      Fix over-eager implication constraint discard · 80afdf6b
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      Ticket #16247 showed that we were discarding an implication
      constraint that had empty ic_wanted, when we still needed to
      keep it so we could check whether it had a bad telescope.
      
      Happily it's a one line fix.  All the rest is comments!
      80afdf6b
    • Simon Peyton Jones's avatar
      Add a missing zonk (fixes #16902) · 53aa59f3
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      In the eager unifier, when unifying (tv1 ~ tv2),
      when we decide to swap them over, to unify (tv2 ~ tv1),
      I'd forgotten to ensure that tv1's kind was fully zonked,
      which is an invariant of uUnfilledTyVar2.
      
      That could lead us to build an infinite kind, or (in the
      case of #16902) update the same unification variable twice.
      
      Yikes.
      
      Now we get an error message rather than non-termination,
      which is much better.  The error message is not great,
      but it's a very strange program, and I can't see an easy way
      to improve it, so for now I'm just committing this fix.
      
      Here's the decl
       data F (a :: k) :: (a ~~ k) => Type where
          MkF :: F a
      
      and the rather error message of which I am not proud
      
        T16902.hs:11:10: error:
          • Expected a type, but found something with kind ‘a1’
          • In the type ‘F a’
      53aa59f3
    • Vladislav Zavialov's avatar
      Produce all DerivInfo in tcTyAndClassDecls · 679427f8
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      Before this refactoring:
      
      * DerivInfo for data family instances was returned from tcTyAndClassDecls
      * DerivInfo for data declarations was generated with mkDerivInfos and added at a
        later stage of the pipeline in tcInstDeclsDeriv
      
      After this refactoring:
      
      * DerivInfo for both data family instances and data declarations is returned from
        tcTyAndClassDecls in a single list.
      
      This uniform treatment results in a more convenient arrangement to fix #16731.
      679427f8
  14. Jul 03, 2019
  15. Jul 02, 2019
  16. Jun 27, 2019
  17. Jun 26, 2019
Loading