Skip to content
Snippets Groups Projects
  1. Sep 19, 2023
    • John Ericson's avatar
      Remove `ghc-cabal` · 35bc506b
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      It is dead code since the Make build system was removed.
      
      I tried to go over every match of `git grep -i ghc-cabal` to find other
      stray bits. Some of those might be workarounds that can be further
      removed.
      35bc506b
    • 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
    • sheaf's avatar
      Avoid panic in mkGADTVars · aba18424
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This commit avoids panicking in mkGADTVars when we encounter
      a type variable as in #23784 that is bound by a user-written
      forall but not actually used.
      
      Fixes #23784
      aba18424
    • sheaf's avatar
      Pass quantified tyvars in tcDefaultAssocDecl · 5f826c18
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This commit passes the correct set of quantified type variables written
      by the user in associated type default declarations for validity
      checking. This ensures that validity checking of associated type defaults
      mirrors that of standalone type family instances.
      
      Fixes #23768 (see testcase T23734 in subsequent commit)
      5f826c18
    • 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
  2. Sep 18, 2023
  3. 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
  4. 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
      Tiny refactor · 236a134e
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      canEtaReduceToArity was only called internally, and always with
      two arguments equal to zero.  This patch just specialises the
      function, and renames it to cantEtaReduceFun.
      
      No change in behaviour.
      236a134e
    • Krzysztof Gogolewski's avatar
      Avoid serializing BCOs with the internal interpreter · dfc4f426
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      Refs #23919
      dfc4f426
  5. Sep 12, 2023
  6. Sep 08, 2023
  7. Sep 07, 2023
    • Krzysztof Gogolewski's avatar
      Fix wrong role in mkSelCo_maybe · e0aa8c6e
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      In the Lint failure in #23938, we start with a coercion Refl :: T a ~R T a,
      and call mkSelCo (SelTyCon 1 nominal) Refl.
      The function incorrectly returned Refl :: a ~R a. The returned role
      should be nominal, according to the SelCo rule:
      
            co : (T s1..sn) ~r0 (T t1..tn)
            r = tyConRole tc r0 i
            ----------------------------------
            SelCo (SelTyCon i r) : si ~r ti
      
      In this test case, r is nominal while r0 is representational.
      e0aa8c6e
    • Alan Zimmerman's avatar
      EPA: Incorrect locations for UserTyVar with '@' · b34f8586
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      In T13343.hs, the location for the @ is not within the span of the
      surrounding UserTyVar.
      
        type Bad @v = (forall (v1 :: RuntimeRep) (a1 :: TYPE v). a1) :: TYPE v
      
      Widen it so it is captured.
      
      Closes #23887
      b34f8586
  8. Sep 06, 2023
  9. Sep 05, 2023
  10. Sep 01, 2023
  11. Aug 30, 2023
  12. Aug 29, 2023
    • sheaf's avatar
      Export setInertSet from GHC.Tc.Solver.Monad · e542d590
      sheaf authored and Marge Bot's avatar Marge Bot committed
      We used to export getTcSInerts and setTcSInerts from GHC.Tc.Solver.Monad.
      These got renamed to getInertSet/setInertSet in e1590ddc. That commit also removed
      the export of setInertSet, but that function is useful for the GHC API.
      e542d590
    • Krzysztof Gogolewski's avatar
      Misc cleanup · b60d6576
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      - Builtin.PrimOps: ReturnsAlg was used only for unboxed tuples.
        Rename to ReturnsTuple.
      - Builtin.Utils: use SDoc for a panic message.
        The comment about <<details unavailable>> was obsoleted by e8d35677.
      - TagCheck: fix wrong logic. It was zipping a list 'args' with its
        version 'args_cmm' after filtering.
      - Core.Type: remove an outdated 1999 comment about unlifted polymorphic types
      - hadrian: remove leftover debugging print
      b60d6576
    • Vasily Sterekhov's avatar
      Make some evidence uses reachable by toHie · 4f192947
      Vasily Sterekhov authored and Marge Bot's avatar Marge Bot committed
      Resolves #23540, #23120
      
      This adds spans to certain expressions in the typechecker and renamer,
      and lets 'toHie' make use of those spans. Therefore the relevant
      evidence uses for the following syntax will now show up under the
      expected nodes in 'HieAst's:
      
      - Overloaded literals ('IsString', 'Num', 'Fractional')
      
      - Natural patterns and N+k patterns ('Eq', 'Ord', and instances from the
        overloaded literals being matched on)
      
      - Arithmetic sequences ('Enum')
      
      - Monadic bind statements ('Monad')
      
      - Monadic body statements ('Monad', 'Alternative')
      
      - ApplicativeDo ('Applicative', 'Functor')
      
      - Overloaded lists ('IsList')
      
      Also see Note [Source locations for implicit function calls]
      
      In the process of handling overloaded lists I added an extra 'SrcSpan'
      field to 'VAExpansion' - this allows us to more accurately reconstruct
      the locations from the renamer in 'rebuildHsApps'. This also happens to
      fix #23120.
      
      See the additions to Note [Looking through HsExpanded]
      4f192947
  13. Aug 28, 2023
  14. Aug 27, 2023
Loading