Skip to content
Snippets Groups Projects
  1. Feb 14, 2024
    • Alan Zimmerman's avatar
      EPA: Move EpAnn out of extension points · 0e01e1db
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Leaving a few that are too tricky, maybe some other time.
      
      Also
       - remove some unneeded helpers from Parser.y
       - reduce allocations with strictness annotations
      
      Updates haddock submodule
      
      Metric Decrease:
          parsing001
      0e01e1db
  2. Dec 13, 2023
  3. Dec 06, 2023
    • Vladislav Zavialov's avatar
      T2T in Patterns (#23739) · 0f0c53a5
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch implements the T2T (term-to-type) transformation in patterns.
      Patterns that are checked against a visible forall can now be written
      without the `type` keyword:
      
      	  \(type t) (x :: t) -> ...   -- old
      	  \t (x :: t) -> ...          -- new
      
      The `t` binder is parsed and renamed as a term pattern (Pat), but
      then undergoes a conversion to a type pattern (HsTyPat).
      See the new function pat_to_type_pat in compiler/GHC/Tc/Gen/Pat.hs
      0f0c53a5
  4. Nov 27, 2023
    • Alan Zimmerman's avatar
      EPA: Remove SrcSpanAnn · 4e5ff6a4
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Now that we only have a single constructor for EpAnn, And it uses a
      SrcSpan for its location, we can do away with SrcSpanAnn completely.
      It only existed to wrap the original SrcSpan in a location, and
      provide a place for the exact print annotation.
      
      For darwin only:
      Metric Increase:
          MultiLayerModulesTH_OneShot
      
      Updates haddock submodule
      4e5ff6a4
  5. Nov 26, 2023
    • Alan Zimmerman's avatar
      EPA: Remove EpAnnNotUsed · 7902ebf8
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      We no longer need the EpAnnNotUsed constructor for EpAnn, as we can
      represent an unused annotation with an anchor having a EpaDelta of
      zero, and empty comments and annotations.
      
      This simplifies code handling annotations considerably.
      
      Updates haddock submodule
      
      Metric Increase:
          parsing001
      7902ebf8
  6. Nov 12, 2023
    • Alan Zimmerman's avatar
      EPA: Replace Anchor with EpaLocation · 3f0036ec
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      An Anchor has a location and an operation, which is either that it is
      unchanged or that it has moved with a DeltaPos
      
          data Anchor = Anchor { anchor :: RealSrcSpan
                               , anchor_op :: AnchorOperation }
      
      An EpaLocation also has either a location or a DeltaPos
      
          data EpaLocation = EpaSpan !RealSrcSpan !(Strict.Maybe BufSpan)
                           | EpaDelta !DeltaPos ![LEpaComment]
      
      Now that we do not care about always having a location in the anchor,
      we remove Anchor and replace it with EpaLocation
      
      We do this with a type alias initially, to ease the transition.
      The alias will be removed in time.
      
      We also have helpers to reconstruct the AnchorOperation from an
      EpaLocation. This is also temporary.
      
      Updates Haddock submodule
      3f0036ec
  7. Aug 01, 2023
  8. Jul 10, 2023
    • Jade's avatar
      Add a hint to enable ExplicitNamespaces for type operator imports (Fixes/Enhances #20007) · 8e11630e
      Jade authored and Marge Bot's avatar Marge Bot committed
      As suggested in #20007 and implemented in !8895, trying to import type operators
      will suggest a fix to use the 'type' keyword, without considering whether
      ExplicitNamespaces is enabled. This patch will query whether ExplicitNamespaces
      is enabled and add a hint to suggest enabling ExplicitNamespaces if it isn't enabled,
      alongside the suggestion of adding the 'type' keyword.
      8e11630e
  9. May 26, 2023
    • Matthew Pickering's avatar
      error messages: Don't display ghci specific hints for missing packages · 34b44f7d
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Tickets like #22884 suggest that it is confusing that GHC used on the
      command line can suggest options which only work in GHCi.
      
      This ticket uses the error message infrastructure to override certain
      error messages which displayed GHCi specific information so that this
      information is only showed when using GHCi.
      
      The main annoyance is that we mostly want to display errors in the same
      way as before, but with some additional information. This means that the
      error rendering code has to be exported from the Iface/Errors/Ppr.hs
      module.
      
      I am unsure about whether the approach taken here is the best or most
      maintainable solution.
      
      Fixes #22884
      34b44f7d
  10. May 24, 2023
    • Hai Nguyen Quang's avatar
      Migrate errors in GHC.Tc.Validity · 838aaf4b
      Hai Nguyen Quang authored and Marge Bot's avatar Marge Bot committed
      This patch migrates the error messages in GHC.Tc.Validity to use
      the new diagnostic infrastructure.
      
      It adds the constructors:
      
        - TcRnSimplifiableConstraint
        - TcRnArityMismatch
        - TcRnIllegalInstanceDecl, with sub-datatypes for HasField errors
          and fundep coverage condition errors.
      838aaf4b
  11. May 15, 2023
    • sheaf's avatar
      Migrate errors to diagnostics in GHC.Tc.Module · 4d29ecdf
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This commit migrates the errors in GHC.Tc.Module to use the new
      diagnostic infrastructure.
      
      It required a significant overhaul of the compatibility checks between
      an hs-boot or signature module and its implementation; we now use
      a Writer monad to accumulate errors; see the BootMismatch datatype
      in GHC.Tc.Errors.Types, with its panoply of subtypes.
      For the sake of readability, several local functions inside the
      'checkBootTyCon' function were split off into top-level functions.
      
      We split off GHC.Types.HscSource into a "boot or sig" vs "normal hs file"
      datatype, as this mirrors the logic in several other places where we
      want to treat hs-boot and hsig files in a similar fashion.
      
      This commit also refactors the Backpack checks for type synonyms
      implementing abstract data, to correctly reject implementations that
      contain qualified or quantified types (this fixes #23342 and #23344).
      4d29ecdf
    • sheaf's avatar
      Improve "ambiguous occurrence" error messages · 5ae81842
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This error was sometimes a bit confusing, especially when data families
      were involved. This commit improves the general presentation of the
      "ambiguous occurrence" error, and adds a bit of extra context in the
      case of data families.
      
      Fixes #23301
      5ae81842
  12. May 05, 2023
  13. Apr 30, 2023
  14. Apr 26, 2023
  15. Apr 25, 2023
  16. Apr 18, 2023
    • Matthew Pickering's avatar
      Convert interface file loading errors into proper diagnostics · 5e1d33d7
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This patch converts all the errors to do with loading interface files
      into proper structured diagnostics.
      
      * DriverMessage: Sometimes in the driver we attempt to load an interface
        file so we embed the IfaceMessage into the DriverMessage.
      * TcRnMessage: Most the time we are loading interface files during
        typechecking, so we embed the IfaceMessage
      
      This patch also removes the TcRnInterfaceLookupError constructor which
      is superceded by the IfaceMessage, which is now structured compared to
      just storing an SDoc before.
      5e1d33d7
  17. Apr 08, 2023
  18. Apr 03, 2023
    • Haskell-mouse's avatar
      Convert diagnostics in GHC.Rename.HsType to proper TcRnMessage · 8b092910
      Haskell-mouse authored and Marge Bot's avatar Marge Bot committed
      I've turned all occurrences of TcRnUnknownMessage in GHC.Rename.HsType
      module into a proper TcRnMessage.
      Instead, these TcRnMessage messages were introduced:
      
      TcRnDataKindsError
      TcRnUnusedQuantifiedTypeVar
      TcRnIllegalKindSignature
      TcRnUnexpectedPatSigType
      TcRnSectionPrecedenceError
      TcRnPrecedenceParsingError
      TcRnIllegalKind
      TcRnNegativeNumTypeLiteral
      TcRnUnexpectedKindVar
      TcRnBindMultipleVariables
      TcRnBindVarAlreadyInScope
      8b092910
  19. Apr 01, 2023
  20. Mar 21, 2023
    • Andrei Borzenkov's avatar
      Rename () into Unit, (,,...,,) into Tuple<n> (#21294) · a13affce
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      
      This patch implements a part of GHC Proposal #475.
      The key change is in GHC.Tuple.Prim:
      
        - data () = ()
        - data (a,b) = (a,b)
        - data (a,b,c) = (a,b,c)
        ...
        + data Unit = ()
        + data Tuple2 a b = (a,b)
        + data Tuple3 a b c = (a,b,c)
        ...
      
      And the rest of the patch makes sure that Unit and Tuple<n>
      are pretty-printed as () and (,,...,,) in various contexts.
      
      Updates the haddock submodule.
      
      Co-authored-by: default avatarVladislav Zavialov <vlad.z.4096@gmail.com>
      a13affce
  21. Jan 28, 2023
    • Andrei Borzenkov's avatar
      Convert diagnostics in GHC.Rename.Bind to proper TcRnMessage (#20115) · 50b1e2e8
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      I removed all occurrences of TcRnUnknownMessage in GHC.Rename.Bind
      module. Instead, these TcRnMessage messages were introduced:
        TcRnMultipleFixityDecls
        TcRnIllegalPatternSynonymDecl
        TcRnIllegalClassBiding
        TcRnOrphanCompletePragma
        TcRnEmptyCase
        TcRnNonStdGuards
        TcRnDuplicateSigDecl
        TcRnMisplacedSigDecl
        TcRnUnexpectedDefaultSig
        TcRnBindInBootFile
        TcRnDuplicateMinimalSig
      50b1e2e8
  22. Jan 06, 2023
    • Matthew Pickering's avatar
      Only store Name in FunRhs rather than Id with knot-tied fields · ac39e8e9
      Matthew Pickering authored and Marge Bot's avatar Marge Bot 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
      ac39e8e9
  23. Dec 23, 2022
  24. Dec 09, 2022
  25. Nov 09, 2022
    • Giles Anderson's avatar
      Use TcRnDiagnostic in GHC.Tc.TyCl.Instance (#20117) · 92ccb8de
      Giles Anderson authored and Marge Bot's avatar Marge Bot committed
      The following `TcRnDiagnostic` messages have been introduced:
      
      TcRnWarnUnsatisfiedMinimalDefinition
      TcRnMisplacedInstSig
      TcRnBadBootFamInstDeclErr
      TcRnIllegalFamilyInstance
      TcRnAssocInClassErr
      TcRnBadFamInstDecl
      TcRnNotOpenFamily
      92ccb8de
  26. Sep 21, 2022
  27. Sep 13, 2022
    • sheaf's avatar
      Diagnostic codes: acccept test changes · 362cca13
      sheaf authored and Marge Bot's avatar Marge Bot committed
      The testsuite output now contains diagnostic codes, so many tests need
      to be updated at once.
      We decided it was best to keep the diagnostic codes in the testsuite
      output, so that contributors don't inadvertently make changes to the
      diagnostic codes.
      362cca13
  28. Aug 19, 2022
  29. Jul 06, 2022
    • Rodrigo Mesquita's avatar
      Remove many GHC dependencies from L.H.S · fd379d1b
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      Continue to prune the `Language.Haskell.Syntax.*` modules out of GHC
      imports according to the plan in the linked issue.
      
      Moves more GHC-specific declarations to `GHC.*` and brings more required
      GHC-independent declarations to `Language.Haskell.Syntax.*` (extending
      e.g. `Language.Haskell.Syntax.Basic`).
      
      Progress towards #21592
      
      Bump haddock submodule for !8308
      
      -------------------------
      Metric Decrease:
          hard_hole_fits
      -------------------------
      fd379d1b
  30. Jul 03, 2022
  31. Jun 28, 2022
    • Matthew Pickering's avatar
      Cleanup BuiltInSyntax vs UserSyntax · 251471e7
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There was some confusion about whether FUN/TYPE/One/Many should be
      BuiltInSyntax or UserSyntax. The answer is certainly UserSyntax as
      BuiltInSyntax is for things which are directly constructed by the parser
      rather than going through normal renaming channels.
      
      I fixed all the obviously wrong places I could find and added a test for
      the original bug which was caused by this (#21752)
      
      Fixes #21752 #20695 #18302
      251471e7
  32. May 26, 2022
  33. Apr 01, 2022
  34. Feb 16, 2022
  35. Feb 06, 2022
  36. Jan 17, 2022
  37. Jan 05, 2022
    • sheaf's avatar
      Check quoted TH names are in the correct namespace · 5111028e
      sheaf authored and Marge Bot's avatar Marge Bot committed
      When quoting (using a TH single or double quote) a built-in
      name such as the list constructor (:), we didn't always check
      that the resulting 'Name' was in the correct namespace.
      
      This patch adds a check in GHC.Rename.Splice to ensure
      we get a Name that is in the term-level/type-level namespace,
      when using a single/double tick, respectively.
      
      Fixes #20884.
      5111028e
  38. Dec 22, 2021
    • Matthew Pickering's avatar
      testsuite: Remove reqlib modifier · 3ed90911
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The reqlib modifer was supposed to indicate that a test needed a certain
      library in order to work. If the library happened to be installed then
      the test would run as normal.
      
      However, CI has never run these tests as the packages have not been
      installed and we don't want out tests to depend on things which might
      get externally broken by updating the compiler.
      
      The new strategy is to run these tests in head.hackage, where the tests
      have been cabalised as well as possible. Some tests couldn't be
      transferred into the normal style testsuite but it's better than never
      running any of the reqlib tests. head.hackage!169
      
      A few submodules also had reqlib tests and have been updated to remove
      it.
      
      Closes #16264 #20032 #17764 #16561
      3ed90911
  39. Nov 02, 2021
    • Alan Zimmerman's avatar
      EPA: Get rid of bare SrcSpan's in the ParsedSource · 39eed84c
      Alan Zimmerman authored
      The ghc-exactPrint library has had to re-introduce the relatavise
      phase.
      
      This is needed if you change the length of an identifier and want the
      layout to be preserved afterwards.
      
      It is not possible to relatavise a bare SrcSpan, so introduce `SrcAnn
      NoEpAnns` for them instead.
      
      Updates haddock submodule.
      39eed84c
Loading