Skip to content
Snippets Groups Projects
  1. Feb 01, 2023
  2. Jan 28, 2023
  3. Jan 27, 2023
  4. Jan 26, 2023
    • Matthew Pickering's avatar
      ci: Change owner of files in source-tarball job · 78aef3d9
      Matthew Pickering authored and Ben Gamari's avatar Ben Gamari committed
      This fixes errors of the form:
      
      ```
      fatal: detected dubious ownership in repository at '/builds/ghc/ghc'
      To add an exception for this directory, call:
      	git config --global --add safe.directory /builds/ghc/ghc
      inferred 9.7.20230113
      checking for GHC Git commit id... fatal: detected dubious ownership in repository at '/builds/ghc/ghc'
      To add an exception for this directory, call:
      	git config --global --add safe.directory /builds/ghc/ghc
      ```
      
      (cherry picked from commit 4285ce8a)
      78aef3d9
    • Richard Eisenberg's avatar
      Refactor the treatment of loopy superclass dicts · 977cfacf
      Richard Eisenberg authored
      This patch completely re-engineers how we deal with loopy superclass
      dictionaries in instance declarations. It fixes #20666 and #19690
      
      The highlights are
      
      * Recognise that the loopy-superclass business should use precisely
        the Paterson conditions.  This is much much nicer.  See
        Note [Recursive superclasses] in GHC.Tc.TyCl.Instance
      
      * With that in mind, define "Paterson-smaller" in
        Note [Paterson conditions] in GHC.Tc.Validity, and the new
        data type `PatersonSize` in GHC.Tc.Utils.TcType, along with
        functions to compute and compare PatsonSizes
      
      * Use the new PatersonSize stuff when solving superclass constraints
        See Note [Solving superclass constraints] in GHC.Tc.TyCl.Instance
      
      * In GHC.Tc.Solver.Monad.lookupInInerts, add a missing call to
        prohibitedSuperClassSolve.  This was the original cause of #20666.
      
      * Treat (TypeError "stuff") as having PatersonSize zero. See
        Note [Paterson size for type family applications] in GHC.Tc.Utils.TcType.
      
      * Treat the head of a Wanted quantified constraint in the same way
        as the superclass of an instance decl; this is what fixes #19690.
        See GHC.Tc.Solver.Canonical Note [Solving a Wanted forall-constraint]
        (Thanks to Matthew Craven for this insight.)
      
        This entailed refactoring the GivenSc constructor of CtOrigin a bit,
        to say whether it comes from an instance decl or quantified constraint.
      
      * Some refactoring way in which redundant constraints are reported; we
        don't want to complain about the extra, apparently-redundant
        constraints that we must add to an instance decl because of the
        loopy-superclass thing.  I moved some work from GHC.Tc.Errors to
        GHC.Tc.Solver.
      
      * Add a new section to the user manual to describe the loopy
        superclass issue and what rules it follows.
      
      (cherry picked from commit aed1974e)
      977cfacf
    • Matthew Pickering's avatar
      Only store Name in FunRhs rather than Id with knot-tied fields · f326c9db
      Matthew Pickering authored and Ben Gamari's avatar Ben Gamari committed
      All the issues here have been caused by #18758.
      The goal of the ticket is to be able to talk about things like
      `LTyClDecl GhcTc`. In the case of HsMatchContext,
      the correct "context" is whatever we want, and in fact storing just a
      `Name` is sufficient and correct context, even if the rest of the AST is
      storing typechecker Ids.
      
      So this reverts (#20415, !5579) which intended to get closed to #18758 but
      didn't really and introduced a few subtle bugs.
      
      Printing of an error message in #22695 would just hang, because we would
      attempt to print the `Id` in debug mode to assertain whether it was
      empty or not. Printing the Name is fine for the error message.
      
      Another consequence is that when `-dppr-debug` was enabled the compiler would
      hang because the debug printing of the Id would try and print fields
      which were not populated yet.
      
      This also led to 32070e6c having to add
      a workaround for the `checkArgs` function which was probably a very
      similar bug to #22695.
      
      Fixes #22695
      
      (cherry picked from commit ac39e8e9)
      f326c9db
    • Oleg Grenrus's avatar
      Fix #22728: Not all diagnostics in safe check are fatal · ba512fa1
      Oleg Grenrus authored and Ben Gamari's avatar Ben Gamari committed
      Also add tests for the issue and -Winferred-safe-imports in general
      
      (cherry picked from commit 1b812b69)
      ba512fa1
    • Ryan Scott's avatar
      Add missing parenthesizeHsType in cvtSigTypeKind · 78f701e5
      Ryan Scott authored
      We need to ensure that the output of `cvtSigTypeKind` is parenthesized (at
      precedence `sigPrec`) so that any type signatures with an outermost, explicit
      kind signature can parse correctly.
      
      Fixes #22784.
      
      (cherry picked from commit 4efee43d)
      78f701e5
    • Luite Stegeman's avatar
      Add PrimCallConv support to GHCi · 45426a6d
      Luite Stegeman authored and Ben Gamari's avatar Ben Gamari committed
      This adds support for calling Cmm code from bytecode using the native
      calling convention, allowing modules that use `foreign import prim`
      to be loaded and debugged in GHCi.
      
      This patch introduces a new `PRIMCALL` bytecode instruction and
      a helper stack frame `stg_primcall`. The code is based on the
      existing functionality for dealing with unboxed tuples in bytecode,
      which has been generalised to handle arbitrary calls.
      
      Fixes #22051
      
      (cherry picked from commit b4c14c4b)
      45426a6d
    • Luite Stegeman's avatar
      Add support for sized literals in the bytecode interpreter. · 7679d3ef
      Luite Stegeman authored and Ben Gamari's avatar Ben Gamari committed
      The bytecode interpreter only has branching instructions for
      word-sized values. These are used for pattern matching.
      Branching instructions for other types (e.g. Int16# or Word8#)
      weren't needed, since unoptimized Core or STG never requires
      branching on types like this.
      
      It's now possible for optimized STG to reach the bytecode
      generator (e.g. fat interface files or certain compiler flag
      combinations), which requires dealing with various sized
      literals in branches.
      
      This patch improves support for generating bytecode from
      optimized STG by adding the following new bytecode
      instructions:
      
          TESTLT_I64
          TESTEQ_I64
          TESTLT_I32
          TESTEQ_I32
          TESTLT_I16
          TESTEQ_I16
          TESTLT_I8
          TESTEQ_I8
          TESTLT_W64
          TESTEQ_W64
          TESTLT_W32
          TESTEQ_W32
          TESTLT_W16
          TESTEQ_W16
          TESTLT_W8
          TESTEQ_W8
      
      Fixes #21945
      
      (cherry picked from commit 28f8c0eb)
      7679d3ef
Loading