1. 30 Dec, 2019 1 commit
  2. 09 Nov, 2019 1 commit
    • Ben Gamari's avatar
      testsuite: Remove redundant cleaning logic from T16511 · 1f871e70
      Ben Gamari authored
      The GHCi script for T16511 had some `rm` commands to clean up output
      from previous runs. This should be harmless since stderr was redirected
      to /dev/null; however, it seems that this redirection doesn't work on
      Windows (perhaps because GHCi uses `cmd` to execute the command-line;
      I'm not sure). I tried to fix it but was unable to find a sensible
      solution.
      
      Regardless, the cleaning logic is quite redundant now that we run each
      test in a hermetic environment. Let's just remove it.
      1f871e70
  3. 08 Nov, 2019 1 commit
  4. 05 Nov, 2019 1 commit
    • Peter Trommler's avatar
      testsuite: skip test requiring RTS linker on PowerPC · 487ede42
      Peter Trommler authored
      The RTS linker is not available on 64-bit PowerPC. Instead of
      marking tests that require the RTS linker as broken on PowerPC
      64-bit skip the respective tests on all platforms where the
      RTS linker or a statically linked external interpreter is not
      available.
      
      Fixes #11259
      487ede42
  5. 29 Oct, 2019 1 commit
  6. 16 Oct, 2019 1 commit
  7. 01 Oct, 2019 1 commit
  8. 28 Sep, 2019 1 commit
  9. 25 Sep, 2019 1 commit
    • Vladislav Zavialov's avatar
      Standalone kind signatures (#16794) · 0b5eede9
      Vladislav Zavialov authored
      Implements GHC Proposal #54: .../ghc-proposals/blob/master/proposals/0054-kind-signatures.rst
      
      With this patch, a type constructor can now be given an explicit
      standalone kind signature:
      
        {-# LANGUAGE StandaloneKindSignatures #-}
        type Functor :: (Type -> Type) -> Constraint
        class Functor f where
          fmap :: (a -> b) -> f a -> f b
      
      This is a replacement for CUSKs (complete user-specified
      kind signatures), which are now scheduled for deprecation.
      
      User-facing changes
      -------------------
      
      * A new extension flag has been added, -XStandaloneKindSignatures, which
        implies -XNoCUSKs.
      
      * There is a new syntactic construct, a standalone kind signature:
      
          type <name> :: <kind>
      
        Declarations of data types, classes, data families, type families, and
        type synonyms may be accompanied by a standalone kind signature.
      
      * A standalone kind signature enables polymorphic recursion in types,
        just like a function type signature enables polymorphic recursion in
        terms. This obviates the need for CUSKs.
      
      * TemplateHaskell AST has been extended with 'KiSigD' to represent
        standalone kind signatures.
      
      * GHCi :info command now prints the kind signature of type constructors:
      
          ghci> :info Functor
          type Functor :: (Type -> Type) -> Constraint
          ...
      
      Limitations
      -----------
      
      * 'forall'-bound type variables of a standalone kind signature do not
        scope over the declaration body, even if the -XScopedTypeVariables is
        enabled. See #16635 and #16734.
      
      * Wildcards are not allowed in standalone kind signatures, as partial
        signatures do not allow for polymorphic recursion.
      
      * Associated types may not be given an explicit standalone kind
        signature. Instead, they are assumed to have a CUSK if the parent class
        has a standalone kind signature and regardless of the -XCUSKs flag.
      
      * Standalone kind signatures do not support multiple names at the moment:
      
          type T1, T2 :: Type -> Type   -- rejected
          type T1 = Maybe
          type T2 = Either String
      
        See #16754.
      
      * Creative use of equality constraints in standalone kind signatures may
        lead to GHC panics:
      
          type C :: forall (a :: Type) -> a ~ Int => Constraint
          class C a where
            f :: C a => a -> Int
      
        See #16758.
      
      Implementation notes
      --------------------
      
      * The heart of this patch is the 'kcDeclHeader' function, which is used to
        kind-check a declaration header against its standalone kind signature.
        It does so in two rounds:
      
          1. check user-written binders
          2. instantiate invisible binders a la 'checkExpectedKind'
      
      * 'kcTyClGroup' now partitions declarations into declarations with a
        standalone kind signature or a CUSK (kinded_decls) and declarations
        without either (kindless_decls):
      
          * 'kinded_decls' are kind-checked with 'checkInitialKinds'
          * 'kindless_decls' are kind-checked with 'getInitialKinds'
      
      * DerivInfo has been extended with a new field:
      
          di_scoped_tvs :: ![(Name,TyVar)]
      
        These variables must be added to the context in case the deriving clause
        references tcTyConScopedTyVars. See #16731.
      0b5eede9
  10. 16 Sep, 2019 1 commit
    • Sebastian Graf's avatar
      Encode shape information in `PmOracle` · 7915afc6
      Sebastian Graf authored
      Previously, we had an elaborate mechanism for selecting the warnings to
      generate in the presence of different `COMPLETE` matching groups that,
      albeit finely-tuned, produced wrong results from an end user's
      perspective in some cases (#13363).
      
      The underlying issue is that at the point where the `ConVar` case has to
      commit to a particular `COMPLETE` group, there's not enough information
      to do so and the status quo was to just enumerate all possible complete
      sets nondeterministically.  The `getResult` function would then pick the
      outcome according to metrics defined in accordance to the user's guide.
      But crucially, it lacked knowledge about the order in which affected
      clauses appear, leading to the surprising behavior in #13363.
      
      In !1010 we taught the term oracle to reason about literal values a
      variable can certainly not take on. This MR extends that idea to
      `ConLike`s and thereby fixes #13363: Instead of committing to a
      particular `COMPLETE` group in the `ConVar` case, we now split off the
      matching constructor incrementally and record the newly covered case as
      a refutable shape in the oracle. Whenever the set of refutable shapes
      covers any `COMPLETE` set, the oracle recognises vacuosity of the
      uncovered set.
      
      This patch goes a step further: Since at this point the information
      in value abstractions is merely a cut down representation of what the
      oracle knows, value abstractions degenerate to a single `Id`, the
      semantics of which is determined by the oracle state `Delta`.
      Value vectors become lists of `[Id]` given meaning to by a single
      `Delta`, value set abstractions (of which the uncovered set is an
      instance) correspond to a union of `Delta`s which instantiate the
      same `[Id]` (akin to models of formula).
      
      Fixes #11528 #13021, #13363, #13965, #14059, #14253, #14851, #15753, #17096, #17149
      
      -------------------------
      Metric Decrease:
          ManyAlternatives
          T11195
      -------------------------
      7915afc6
  11. 19 Jul, 2019 1 commit
  12. 14 Jul, 2019 1 commit
    • John Ericson's avatar
      Expunge #ifdef and #ifndef from the codebase · d7c6c471
      John Ericson authored
      These are unexploded minds as far as the linter is concerned. I don't
      want to hit in my MRs by mistake!
      
      I did this with `sed`, and then rolled back some changes in the docs,
      config.guess, and the linter itself.
      d7c6c471
  13. 10 Jul, 2019 2 commits
    • Ömer Sinan Ağacan's avatar
      Testsuite tweaks and refactoring · d7423f10
      Ömer Sinan Ağacan authored
      - 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
    • Phuong Trinh's avatar
      Fix #16511: changes in interface dependencies should trigger recompilation · b05c8423
      Phuong Trinh authored
      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
  14. 26 Jun, 2019 2 commits
  15. 25 Jun, 2019 1 commit
    • Ben Gamari's avatar
      testsuite: A major revamp of the driver · c346585b
      Ben Gamari authored
      This tries to put the testsuite driver into a slightly more maintainable
      condition:
      
      * Add type annotations where easily done
      * Use pathlib.Path instead of str paths
      * Make it pass the mypy typechecker
      c346585b
  16. 22 Jun, 2019 1 commit
  17. 21 Jun, 2019 1 commit
  18. 20 Jun, 2019 2 commits
  19. 16 Jun, 2019 1 commit
  20. 14 Jun, 2019 1 commit
    • Andrew Martin's avatar
      Implement the -XUnliftedNewtypes extension. · effdd948
      Andrew Martin authored
      GHC Proposal: 0013-unlifted-newtypes.rst
      Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/98
      Issues: #15219, #1311, #13595, #15883
      Implementation Details:
        Note [Implementation of UnliftedNewtypes]
        Note [Unifying data family kinds]
        Note [Compulsory newtype unfolding]
      
      This patch introduces the -XUnliftedNewtypes extension. When this
      extension is enabled, GHC drops the restriction that the field in
      a newtype must be of kind (TYPE 'LiftedRep). This allows types
      like Int# and ByteArray# to be used in a newtype. Additionally,
      coerce is made levity-polymorphic so that it can be used with
      newtypes over unlifted types.
      
      The bulk of the changes are in TcTyClsDecls.hs. With -XUnliftedNewtypes,
      getInitialKind is more liberal, introducing a unification variable to
      return the kind (TYPE r0) rather than just returning (TYPE 'LiftedRep).
      When kind-checking a data constructor with kcConDecl, we attempt to
      unify the kind of a newtype with the kind of its field's type. When
      typechecking a data declaration with tcTyClDecl, we again perform a
      unification. See the implementation note for more on this.
      Co-authored-by: Richard Eisenberg's avatarRichard Eisenberg <rae@richarde.dev>
      effdd948
  21. 12 Jun, 2019 4 commits
  22. 09 Jun, 2019 1 commit
    • KevinBuhr's avatar
      Handle trailing path separator in package DB names (#16360) · 9d238791
      KevinBuhr authored
      Package DB directories with trailing separator (provided via
      GHC_PACKAGE_PATH or via -package-db) resulted in incorrect calculation of
      ${pkgroot} substitution variable.  Keep the trailing separator while
      resolving as directory or file, but remove it before dropping the last
      path component with takeDirectory.
      
      Closes #16360.
      9d238791
  23. 07 Jun, 2019 1 commit
  24. 30 May, 2019 1 commit
    • Daniel Gröber (dxld)'s avatar
      Catch preprocessor errors in downsweep · 99e72769
      Daniel Gröber (dxld) authored
      This changes the way preprocessor failures are presented to the
      user. Previously the user would simply get an unlocated message on stderr
      such as:
      
          `gcc' failed in phase `C pre-processor'. (Exit code: 1)
      
      Now at the problematic source file is mentioned:
      
          A.hs:1:1: error:
              `gcc' failed in phase `C pre-processor'. (Exit code: 1)
      
      This also makes live easier for GHC API clients as the preprocessor error
      is now thrown as a SourceError exception.
      99e72769
  25. 21 May, 2019 1 commit
  26. 14 May, 2019 1 commit
    • Vladislav Zavialov's avatar
      Guard CUSKs behind a language pragma · a5fdd185
      Vladislav Zavialov authored
      GHC Proposal #36 describes a transition plan away from CUSKs and to
      top-level kind signatures:
      
      1. Introduce a new extension, -XCUSKs, on by default, that detects CUSKs
         as they currently exist.
      2. We turn off the -XCUSKs extension in a few releases and remove it
         sometime thereafter.
      
      This patch implements phase 1 of this plan, introducing a new language
      extension to control whether CUSKs are enabled. When top-level kind
      signatures are implemented, we can transition to phase 2.
      a5fdd185
  27. 08 May, 2019 1 commit
  28. 16 Apr, 2019 1 commit
    • Dmitry Dolgov's avatar
      Show dynamic object files (#16062) · 57eb5bc6
      Dmitry Dolgov authored
      Closes #16062. When -dynamic-too is specified, reflect that in the
      progress message, like:
      
      $ ghc Main.hs -dynamic-too
      [1 of 1] Compiling Lib              ( Main.hs, Main.o, Main.dyn_o )
      
      instead of:
      
      $ ghc Main.hs -dynamic-too
      [1 of 1] Compiling Lib              ( Main.hs, Main.o )
      57eb5bc6
  29. 08 Apr, 2019 1 commit
    • Phuong Trinh's avatar
      Fix #16500: look for interface files in -hidir flag in OneShot mode · 2b3f4718
      Phuong Trinh authored
      We are currently ignoring options set in the hiDir field of hsc_dflags
      when looking for interface files while compiling in OneShot mode. This
      is inconsistent with the behaviour of other directory redirecting fields
      (such as objectDir or hieDir). It is also inconsistent with the
      behaviour of compilation in CompManager mode (a.k.a `ghc --make`) which
      looks for interface files in the directory set in hidir flag. This
      changes Finder.hs so that we use the value of hiDir while looking for
      interface in OneShot mode.
      2b3f4718
  30. 01 Apr, 2019 1 commit
  31. 22 Mar, 2019 1 commit
  32. 11 Mar, 2019 1 commit
    • Alec Theriault's avatar
      Ignore more version numbers in the testsuite · bcb6769c
      Alec Theriault authored
      Prevents some tests from failing just due to mismatched version numbers.
      
      These version numbers shouldn't cause tests to fail, especially since
      we *expect* them to be regularly incremented. The motivation for this
      particular set of changes came from the changes that came along with
      the `base` version bump in 8f19ecc9.
      bcb6769c
  33. 07 Feb, 2019 1 commit
  34. 30 Jan, 2019 1 commit