1. 15 Dec, 2016 1 commit
  2. 29 Nov, 2016 1 commit
    • Sylvain Henry's avatar
      Replace -fshow-source-paths with -fhide-source-paths · 3ec85630
      Sylvain Henry authored
      This patch reverts the change introduced with
      587dcccf and restores the previous
      default output of GHC (i.e., show source path and object path for each
      compiled module).
      
      The -fhide-source-paths flag can be used to hide these paths and reduce
      the line
      noise.
      
      Reviewers: gracjan, nomeata, austin, bgamari, simonmar, hvr
      
      Reviewed By: hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2728
      
      GHC Trac Issues: #12851
      3ec85630
  3. 21 Nov, 2016 1 commit
    • Maciej Bielecki's avatar
      Implement fine-grained `-Werror=...` facility · 514acfe4
      Maciej Bielecki authored
      This patch add new options `-Werror=...`, `-Wwarn=...` and
      `-Wno-error=...` (synonym for `-Wwarn=...`).
      
      Semantics:
      
        - `-Werror` marks all warnings as fatal, including those that don't
          have a warning flag, and CPP warnings.
        - `-Werror=...` enables a warning and marks it as fatal
        - `-Wwarn=...` marks a warning as non-fatal, but doesn't disable it
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: mpickering, svenpanne, RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2706
      
      GHC Trac Issues: #11219
      514acfe4
  4. 12 Nov, 2016 1 commit
  5. 21 Oct, 2016 1 commit
    • Simon Peyton Jones's avatar
      A collection of type-inference refactorings. · 3f5673f3
      Simon Peyton Jones authored
      This patch does a raft of useful tidy-ups in the type checker.
      I've been meaning to do this for some time, and finally made
      time to do it en route to ICFP.
      
      1. Modify TcType.ExpType to make a distinct data type,
         InferResult for the Infer case, and consequential
         refactoring.
      
      2. Define a new function TcUnify.fillInferResult, to fill in
         an InferResult. It uses TcMType.promoteTcType to promote
         the type to the level of the InferResult.
         See TcMType Note [Promoting a type]
         This refactoring is in preparation for an improvement
         to typechecking pattern bindings, coming next.
      
         I flirted with an elaborate scheme to give better
         higher rank inference, but it was just too complicated.
         See TcMType Note [Promotion and higher rank types]
      
      3. Add to InferResult a new field ir_inst :: Bool to say
         whether or not the type used to fill in the
         InferResult should be deeply instantiated.  See
         TcUnify Note [Deep instantiation of InferResult].
      
      4. Add a TcLevel to SkolemTvs. This will be useful generally
      
          - it's a fast way to see if the type
            variable escapes when floating (not used yet)
      
          - it provides a good consistency check when updating a
            unification variable (TcMType.writeMetaTyVarRef, the
            level_check_ok check)
      
         I originally had another reason (related to the flirting
         in (2), but I left it in because it seems like a step in
         the right direction.
      
      5. Reduce and simplify the plethora of uExpType,
         tcSubType and related functions in TcUnify.  It was
         such an opaque mess and it's still not great, but it's
         better.
      
      6. Simplify the uo_expected field of TypeEqOrigin.  Richard
         had generatlised it to a ExpType, but it was almost always
         a Check type.  Now it's back to being a plain TcType which
         is much, much easier.
      
      7. Improve error messages by refraining from skolemisation when
         it's clear that there's an error: see
         TcUnify Note [Don't skolemise unnecessarily]
      
      8. Type.isPiTy and isForAllTy seem to be missing a coreView check,
         so I added it
      
      9. Kill off tcs_used_tcvs.  Its purpose is to track the
         givens used by wanted constraints.  For dictionaries etc
         we do that via the free vars of the /bindings/ in the
         implication constraint ic_binds.  But for coercions we
         just do update-in-place in the type, rather than
         generating a binding.  So we need something analogous to
         bindings, to track what coercions we have added.
      
         That was the purpose of tcs_used_tcvs.  But it only
         worked for a /single/ iteration, whereas we may have
         multiple iterations of solving an implication.  Look
         at (the old) 'setImplicationStatus'.  If the constraint
         is unsolved, it just drops the used_tvs on the floor.
         If it becomes solved next time round, we'll pick up
         coercions used in that round, but ignore ones used in
         the first round.
      
         There was an outright bug.  Result = (potentialy) bogus
         unused-constraint errors.  Constructing a case where this
         actually happens seems quite trick so I did not do so.
      
         Solution: expand EvBindsVar to include the (free vars of
         the) coercions, so that the coercions are tracked in
         essentially the same way as the bindings.
      
         This turned out to be much simpler.  Less code, more
         correct.
      
      10. Make the ic_binds field in an implication have type
            ic_binds :: EvBindsVar
          instead of (as previously)
             ic_binds :: Maybe EvBindsVar
          This is notably simpler, and faster to use -- less
          testing of the Maybe.  But in the occaional situation
          where we don't have anywhere to put the bindings, the
          belt-and-braces error check is lost.  So I put it back
          as an ASSERT in 'setImplicationStatus' (see the use of
          'termEvidenceAllowed')
      
      All these changes led to quite bit of error message wibbling
      3f5673f3
  6. 07 Oct, 2016 1 commit
  7. 26 Sep, 2016 1 commit
  8. 31 Aug, 2016 1 commit
  9. 20 Jun, 2016 1 commit
  10. 04 May, 2016 1 commit
    • niteria's avatar
      Kill non-deterministic foldUFM in TrieMap and TcAppMap · ad4392c1
      niteria authored
      Summary:
      foldUFM introduces unnecessary non-determinism that actually
      leads to different generated code as explained in
      Note [TrieMap determinism].
      
      As we're switching from UniqFM to UniqDFM here you might be
      concerned about performance. There's nothing that ./validate
      detects. nofib reports no change in Compile Allocations, but
      Compile Time got better on some tests and worse on some,
      yielding this summary:
      
              -1 s.d.                -----            -3.8%
              +1 s.d.                -----            +5.4%
              Average                -----            +0.7%
      
      This is not a fair comparison as the order of Uniques
      changes what GHC is actually doing. One benefit from making
      this deterministic is also that it will make the
      performance results more stable.
      
      Full nofib results: P108
      
      Test Plan: ./validate, nofib
      
      Reviewers: goldfire, simonpj, simonmar, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2169
      
      GHC Trac Issues: #4012
      ad4392c1
  11. 30 Mar, 2016 1 commit
  12. 29 Feb, 2016 1 commit
  13. 27 Feb, 2016 2 commits
  14. 25 Feb, 2016 2 commits
    • barrucadu's avatar
      Print which warning-flag controls an emitted warning · bb5afd3c
      barrucadu authored
      Both gcc and clang tell which warning flag a reported warning can be
      controlled with, this patch makes ghc do the same. More generally, this
      allows for annotated compiler output, where an optional annotation is
      displayed in brackets after the severity.
      
      This also adds a new flag `-f(no-)show-warning-groups` to control
      whether to show which warning-group (such as `-Wall` or `-Wcompat`)
      a warning belongs to. This flag is on by default.
      
      This implements #10752
      
      Reviewed By: quchen, bgamari, hvr
      
      Differential Revision: https://phabricator.haskell.org/D1943
      bb5afd3c
    • manav's avatar
      Make warning names more consistent · 66584914
      manav authored
      - Replace "Sigs" with "Signatures" in WarningFlag data constructors.
      - Replace "PatSyn" with "PatternSynonym" in WarningFlag data
        constructors.
      - Deprecate "missing-local-sigs" in favor of "missing-local-signatures".
      - Deprecate "missing-exported-sigs" in favor of
        "missing-exported-signatures".
      - Deprecate "missing-pat-syn-signatures" in favor of
        "missing-pattern-synonym-signatures".
      - Replace "ddump-strsigs" with "ddump-str-signatures"
      
      These complete the tasks that were explicitly mentioned in #11583
      
      Test Plan:
      Executed `ghc --show-options` and verified that the flags were changed
      as expected.
      
      Reviewers: svenpanne, austin, bgamari
      
      Reviewed By: austin, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1939
      
      GHC Trac Issues: #11583
      66584914
  15. 16 Feb, 2016 1 commit
  16. 24 Jan, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Implement `-Wnoncanonical-monadfail-instances` warning · fd6dd41c
      Herbert Valerio Riedel authored
      The MonadFail proposal implemented so far via #10751 only warns about
      missing `MonadFail` instances based on existence of failible pattern
      matches in `do`-blocks.
      
      However, based on the noncanonical Monad warnings implemented via #11150
      we can provide a different mechanism for detecting missing `MonadFail`
      instances quite cheaply. That is, by checking for canonical `fail` definitions.
      
      In the case of `Monad`/`MonadFail`, we define the canonical implementation of
      `fail` to be such that the soft-deprecated method shall (iff overridden) be
      defined in terms of the non-deprecated method. Consequently, in case of
      `MonadFail`, the `Monad(fail)` method shall be defined as alias of
      the `MonadFail(fail)` method.
      
      This allows us at some distant point in the future to remove `fail` from
      the `Monad` class, while having GHC ignore/tolerate such literal canonical
      method definitions.
      
      Reviewed By: bgamari, RyanGlScott
      
      Differential Revision: https://phabricator.haskell.org/D1838
      fd6dd41c
  17. 24 Dec, 2015 1 commit
    • eir@cis.upenn.edu's avatar
      Visible type application · 2db18b81
      eir@cis.upenn.edu authored
      This re-working of the typechecker algorithm is based on
      the paper "Visible type application", by Richard Eisenberg,
      Stephanie Weirich, and Hamidhasan Ahmed, to be published at
      ESOP'16.
      
      This patch introduces -XTypeApplications, which allows users
      to say, for example `id @Int`, which has type `Int -> Int`. See
      the changes to the user manual for details.
      
      This patch addresses tickets #10619, #5296, #10589.
      2db18b81
  18. 17 Dec, 2015 1 commit
  19. 11 Dec, 2015 1 commit
    • eir@cis.upenn.edu's avatar
      Add kind equalities to GHC. · 67465497
      eir@cis.upenn.edu authored
      This implements the ideas originally put forward in
      "System FC with Explicit Kind Equality" (ICFP'13).
      
      There are several noteworthy changes with this patch:
       * We now have casts in types. These change the kind
         of a type. See new constructor `CastTy`.
      
       * All types and all constructors can be promoted.
         This includes GADT constructors. GADT pattern matches
         take place in type family equations. In Core,
         types can now be applied to coercions via the
         `CoercionTy` constructor.
      
       * Coercions can now be heterogeneous, relating types
         of different kinds. A coercion proving `t1 :: k1 ~ t2 :: k2`
         proves both that `t1` and `t2` are the same and also that
         `k1` and `k2` are the same.
      
       * The `Coercion` type has been significantly enhanced.
         The documentation in `docs/core-spec/core-spec.pdf` reflects
         the new reality.
      
       * The type of `*` is now `*`. No more `BOX`.
      
       * Users can write explicit kind variables in their code,
         anywhere they can write type variables. For backward compatibility,
         automatic inference of kind-variable binding is still permitted.
      
       * The new extension `TypeInType` turns on the new user-facing
         features.
      
       * Type families and synonyms are now promoted to kinds. This causes
         trouble with parsing `*`, leading to the somewhat awkward new
         `HsAppsTy` constructor for `HsType`. This is dispatched with in
         the renamer, where the kind `*` can be told apart from a
         type-level multiplication operator. Without `-XTypeInType` the
         old behavior persists. With `-XTypeInType`, you need to import
         `Data.Kind` to get `*`, also known as `Type`.
      
       * The kind-checking algorithms in TcHsType have been significantly
         rewritten to allow for enhanced kinds.
      
       * The new features are still quite experimental and may be in flux.
      
       * TODO: Several open tickets: #11195, #11196, #11197, #11198, #11203.
      
       * TODO: Update user manual.
      
      Tickets addressed: #9017, #9173, #7961, #10524, #8566, #11142.
      Updates Haddock submodule.
      67465497
  20. 07 Dec, 2015 1 commit
  21. 02 Dec, 2015 1 commit
  22. 24 Nov, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Implement new `-fwarn-noncanonical-monad-instances` · f09f2470
      Herbert Valerio Riedel authored
      Warn about incoherent/non-canonical 'Applicative'/'Monad' instance
      declarations. Specifically the following invariants are checked:
      
      In 'Monad' instances declarations warn if the any of the following
      conditions does not hold:
      
       * If `return` is overridden it must be canonical (i.e. `return = pure`).
       * If `(>>)` is overridden it must be canonical (i.e. `(>>) = (*>)`).
      
      In 'Applicative' instance declarations:
      
       * Warn if 'pure' is defined backwards (i.e. `pure = return`).
       * Warn if '(*>)' is defined backwards (i.e. `(*>) = (>>)`).
      
      NB, this warning flag is not enabled via `-Wall` nor `-Wcompat`.
      
      This addresses #11128
      
      Reviewers: quchen, austin, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1516
      f09f2470
  23. 30 Oct, 2015 1 commit
    • Simon Peyton Jones's avatar
      Fix unused-import stuff in a better way · 9376249b
      Simon Peyton Jones authored
      The fix for Trac #10890 in commit 1818b48e, namely
         Fix incorrect import warnings when methods with identical names are imported
      was wrong, as demonstrated by the new test T10890_2.  It suppressed
      far too many warnings!
      
      This patch fixes the original problem in a different way, by making
      RdrName.greUsedRdrName a bit cleverer.
      
      But this too is not really the Right Thing.  I think the Right Thing is
      to store the /GRE/ in the tcg_used_rdrnames, not the /RdrName/.  That
      would be a lot simpler and more direct.
      
      But one step at a time.
      9376249b
  24. 13 Oct, 2015 1 commit
    • Ömer Sinan Ağacan's avatar
      Fix incorrect import warnings when methods with identical names are imported · 1818b48e
      Ömer Sinan Ağacan authored
      Currently, GHC's warning generation code is assuming that a name (`RdrName`)
      can be imported at most once. This is a correct assumption, because 1) it's OK
      to import same names as long as we don't use any of them 2) when we use one of
      them, GHC generates an error because it doesn't disambiguate it automatically.
      
      But apparently the story is different with typeclass methods. If I import two
      methods with same names, it's OK to use them in typeclass instance
      declarations, because the context specifies which one to use. For example, this
      is OK (where modules A and B define typeclasses A and B, both with a function
      has),
      
          import A
          import B
      
          data Blah = Blah
      
          instance A Blah where
            has = Blah
      
          instance B Blah where
            has = Blah
      
      But GHC's warning generator is not taking this into account, and so if I change
      import list of this program to:
      
          import A (A (has))
          import B (B (has))
      
      GHC is printing these warnings:
      
          Main.hs:5:1: Warning:
              The import of ‘A.has’ from module ‘A’ is redundant
      
          Main.hs:6:1: Warning:
              The import of ‘B.has’ from module ‘B’ is redundant
      
      Why? Because warning generation code is _silently_ ignoring multiple symbols
      with same names.
      
      With this patch, GHC takes this into account. If there's only one name, then
      this patch reduces to the previous version, that is, it works exactly the same
      as current GHC (thanks goes to @quchen for realizing this).
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D1257
      
      GHC Trac Issues: #10890
      1818b48e
  25. 08 Oct, 2015 1 commit
  26. 21 Aug, 2015 1 commit
  27. 25 Jul, 2015 1 commit
    • Sergei Trofimovich's avatar
      renamer: fix module-level deprecation message · b04bed0a
      Sergei Trofimovich authored
      Noticed today that deprecation warnings are
      slightly broken in -HEAD:
      
        mtl-2.2.1/Control/Monad/Error/Class.hs:46:1: warning:
          Module ‘Control.Monad.Trans.Error’ is deprecated:
            ([", U, s, e,  , C, o, n, t, r, o, l, ., M, o, n, a, d, ., T, r, a,
              n, s, ., E, x, c, e, p, t,  , i, n, s, t, e, a, d, "],
             Use Control.Monad.Trans.Except instead)
      
      Commit e6191d1c
      slightly changed WarningTxt declaration:
      
      -data WarningTxt = WarningTxt (Located SourceText) [Located FastString]
      -                | DeprecatedTxt (Located SourceText) [Located FastString]
      +data WarningTxt = WarningTxt (Located SourceText)
      +                             [Located (SourceText,FastString)]
      +                | DeprecatedTxt (Located SourceText)
      +                                [Located (SourceText,FastString)]
      
      But 'moduleWarn' function was not updated to do the stripping.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      
      Reviewers: austin, bgamari, hvr, goldfire, rwbarton, alanz
      
      Reviewed By: rwbarton, alanz
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1096
      
      GHC Trac Issues: #10313
      b04bed0a
  28. 12 May, 2015 1 commit
  29. 02 Apr, 2015 1 commit
  30. 21 Nov, 2014 1 commit
    • Eric Seidel's avatar
      Add flag `-fwarn-missing-exported-sigs` · 067f1e4f
      Eric Seidel authored
      Summary: add `-fwarn-missing-exported-sigs` to only warn about missing signatures if the name is exported
      
      Test Plan: validate, see testsuite/tests/warnings/should_compile/T2526.hs
      
      Reviewers: ezyang, austin, thomie
      
      Reviewed By: austin, thomie
      
      Subscribers: ezyang, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D482
      
      GHC Trac Issues: #2526
      
      Conflicts:
      	docs/users_guide/7.10.1-notes.xml
      067f1e4f
  31. 21 Oct, 2014 1 commit
    • mlen's avatar
      Enabled warn on tabs by default (fixes #9230) · 972ba121
      mlen authored
      Summary:
      This revision enables -fwarn-tabs by default and add a suppression
      flag, so that GHC compilation won't fail when some files contain tab
      characters.
      
      Test Plan: Additional test case, T9230, was added to cover that change.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: simonmar, ezyang, carter, thomie, mlen
      
      Differential Revision: https://phabricator.haskell.org/D255
      
      GHC Trac Issues: #9230
      
      Conflicts:
      	testsuite/driver/testlib.py
      972ba121
  32. 09 Jun, 2014 1 commit
  33. 25 Feb, 2014 1 commit
  34. 18 Sep, 2013 2 commits