Skip to content
Snippets Groups Projects
  1. Oct 19, 2023
  2. Oct 18, 2023
  3. Oct 14, 2023
    • sheaf's avatar
      Combine GREs when combining in mkImportOccEnv · ec3c4488
      sheaf authored and Marge Bot's avatar Marge Bot committed
      In `GHC.Rename.Names.mkImportOccEnv`, we sometimes discard one import
      item in favour of another, as explained in Note [Dealing with imports]
      in `GHC.Rename.Names`. However, this can cause us to lose track of
      important parent information.
      
      Consider for example #24084:
      
        module M1 where { class C a where { type T a } }
        module M2 ( module M1 ) where { import M1 }
        module M3 where { import M2 ( C, T ); instance C () where T () = () }
      
      When processing the import list of `M3`, we start off (for reasons that
      are not relevant right now) with two `Avail`s attached to `T`, namely
      `C(C, T)` and `T(T)`. We combine them in the `combine` function of
      `mkImportOccEnv`; as described in Note [Dealing with imports] we discard
      `C(C, T)` in favour of `T(T)`. However, in doing so, we **must not**
      discard the information want that `C` is the parent of `T`. Indeed,
      losing track of this information can cause errors when importing,
      as we could get an error of the form
      
        ‘T’ is not a (visible) associated type of class ‘C’
      
      We fix this by combining the two GREs for `T` using `plusGRE`.
      
      Fixes #24084
      ec3c4488
  4. Oct 12, 2023
  5. Oct 10, 2023
  6. Oct 08, 2023
  7. Oct 06, 2023
    • Finley McIlwaine's avatar
      Ensure unconstrained instance dictionaries get IPE info · 69abb171
      Finley McIlwaine authored
      In the `StgRhsCon` case of `GHC.Stg.Debug.collectStgRhs`, we were not coming up
      with an initial source span based on the span of the binder, which was causing
      instance dictionaries without dynamic superclass constraints to not have source
      locations in their IPE info. Now they do.
      
      Resolves #24005
      69abb171
  8. Oct 05, 2023
  9. Oct 04, 2023
  10. Sep 30, 2023
    • Simon Peyton Jones's avatar
      Refactor to combine HsLam and HsLamCase · ef5342cd
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This MR is pure refactoring (#23916):
      * Combine `HsLam` and `HsLamCase`
      * Combine `HsCmdLam` and `HsCmdLamCase`
      
      This just arranges to treat uniformly
         \x -> e
         \case pi -> ei
         \cases pis -> ie
      
      In the exising code base the first is treated differently
      to the latter two.
      
      No change in behaviour.
      
      More specifics:
      
      * Combine `HsLam` and `HsLamCase` (constructors of `Language.Haskell.Syntax.Expr.HsExpr`) into one data construtor covering
        * Lambda
        * `\case`
        * `\cases`
      
      * The new `HsLam` has an argument of type `HsLamVariant` to distinguish the three cases.
      
      * Similarly, combine `HsCmdLam` and `HsCmdLamCase` (constructors of `Language.Haskell.Syntax.Expr.HsCmd` ) into one.
      
      * Similarly, combine `mkHsLamPV` and `mkHsLamCasePV` (methods of class `DisambECP`) into one. (Thank you Alan Zimmerman.)
      
      * Similarly, combine `LambdaExpr` and `LamCaseAlt` (constructors of `Language.Haskell.Syntax.Expr.HsMatchContext`) into one: `LamAlt` with a `HsLamVariant` argument.
      
      * Similarly, combine `KappaExpr` and `ArrowLamCaseAlt` (constructors of `Language.Haskell.Syntax.Expr.HsArrowMatchContext`) into one: `ArrowLamAlt` with a `HsLamVariant` argument.
      
      * Similarly, combine `PsErrLambdaInPat` and `PsErrLambdaCaseInPat` (constructors of `GHC.Parser.Errors.Ppr.PsError`) into one.
      
      * Similarly, combine `PsErrLambdaInPat` and `PsErrLambdaCaseInPat` (constructors of `GHC.Parser.Errors.Ppr.PsError`) into one.
      
      * In the same `PsError` data type, combine `PsErrLambdaCmdInFunAppCmd` and `PsErrLambdaCaseCmdInFunAppCmd` into one.
      
      * In the same `PsError` data tpye, combine `PsErrLambdaInFunAppExpr` and `PsErrLambdaCaseInFunAppExpr` into one.
      
      p* Smilarly combine `ExpectedFunTyLam` and `ExpectedFunTyLamCase` (constructors of `GHC.Tc.Types.Origin.ExpectedFunTyOrigin`) into one.
      
      Phew!
      ef5342cd
    • Torsten Schmits's avatar
      Fix several mistakes around free variables in iface breakpoints · d3874407
      Torsten Schmits authored and Marge Bot's avatar Marge Bot committed
      Fixes #23612 , #23607, #23998 and #23666.
      
      MR: !11026
      
      The fingerprinting logic in `Iface.Recomp` failed lookups when processing decls containing breakpoints for two reasons:
      
      * IfaceBreakpoint created binders for free variables instead of expressions
      
      * When collecting free names for the dependency analysis for fingerprinting, breakpoint FVs were skipped
      d3874407
  11. Sep 28, 2023
  12. Sep 27, 2023
  13. Sep 21, 2023
  14. Sep 19, 2023
    • sheaf's avatar
      Validity: refactor treatment of data families · 1eed645c
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This commit refactors the reporting of unused type variables in type
      and data family instances to be more principled. This avoids ad-hoc
      logic in the treatment of data family instances.
      1eed645c
    • sheaf's avatar
      Unused tyvars in FamInst: only report user tyvars · 28dd52ee
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This commit changes how we perform some validity checking for
      coercion axioms to mirror how we handle default declarations for
      associated type families. This allows us to keep track of whether
      type variables in type and data family instances were user-written
      or not, in order to only report the user-written ones in
      "unused type variable" error messages.
      
      Consider for example:
      
        {-# LANGUAGE PolyKinds #-}
        type family F
        type instance forall a. F = ()
      
      In this case, we get two quantified type variables,
      (k :: Type) and (a :: k); the second being user-written, but the first
      is introduced by the typechecker. We should only report 'a' as being
      unused, as the user has no idea what 'k' is.
      
      Fixes #23734
      28dd52ee
    • sheaf's avatar
      Adjust reporting of unused tyvars in data FamInsts · a525a92a
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This commit adjusts the validity checking of data family
      instances to improve the reporting of unused type variables.
      
      See Note [Out of scope tvs in data family instances] in GHC.Tc.Validity.
      
      The problem was that, in a situation such as
      
        data family D :: Type
        data instance forall (d :: Type). D = MkD
      
      the RHS passed to 'checkFamPatBinders' would be the TyCon app
      
        R:D d
      
      which mentions the type variable 'd' quantified in the user-written
      forall. Thus, when computing the set of unused type variables in
      the RHS of the data family instance, we would find that 'd' is used,
      and report a strange error message that would say that 'd' is not
      bound on the LHS.
      
      To fix this, we special-case the data-family instance case,
      manually extracting all the type variables that appear in the
      arguments of all the data constructores of the data family instance.
      
      Fixes #23778
      a525a92a
    • jeffrey young's avatar
      compiler,ghci: error codes link to HF error index · 86d2971e
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      closes: #23259
      
      - adds -fprint-error-index-links={auto|always|never} flag
      86d2971e
    • Alexis King's avatar
      Don’t store the async exception masking state in CATCH frames · 8b61dfd6
      Alexis King authored and Marge Bot's avatar Marge Bot committed
      8b61dfd6
  15. Sep 18, 2023
  16. Sep 16, 2023
    • Simon Peyton Jones's avatar
      Use correct FunTyFlag in adjustJoinPointType · 8e05c54a
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      As the Lint error in #23952 showed, the function adjustJoinPointType
      was failing to adjust the FunTyFlag when adjusting the type.
      
      I don't think this caused the seg-fault reported in the ticket,
      but it is definitely.  This patch fixes it.
      
      It is tricky to come up a small test case; Krzysztof came up with
      this one, but it only triggers a failure in GHC 9.6.
      8e05c54a
  17. Sep 15, 2023
  18. Sep 13, 2023
    • Simon Peyton Jones's avatar
      Fix eta reduction · 6840012e
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      Issue #23922 showed that GHC was bogusly eta-reducing a join point.
      We should never eta-reduce (\x -> j x) to j, if j is a join point.
      
      It is extremly difficult to trigger this bug.  It took me 45 mins of
      trying to make a small tests case, here immortalised as T23922a.
      6840012e
    • Ben Gamari's avatar
      spec-constr: Lift argument limit for SPEC-marked functions · 56b403c9
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      When the user adds a SPEC argument to a function, they are informing us
      that they expect the function to be specialised. However, previously
      this instruction could be preempted by the specialised-argument limit
      (sc_max_args). Fix this.
      
      This fixes #14003.
      56b403c9
    • Simon Peyton Jones's avatar
      Add -fno-cse to T15426 and T18964 · 98e7c1cf
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This -fno-cse change is to avoid these performance tests depending on
      flukey CSE stuff.  Each contains several independent tests, and we don't
      want them to interact.
      
      See #23925.
      
      By killing CSE we expect a 400% increase in T15426, and 100% in T18964.
      
      Metric Increase:
          T15426
          T18964
      98e7c1cf
Loading