1. 26 Mar, 2016 1 commit
  2. 21 Mar, 2016 3 commits
  3. 20 Mar, 2016 1 commit
  4. 16 Mar, 2016 1 commit
    • eir@cis.upenn.edu's avatar
      Clean up some pretty-printing in errors. · 5d98b8bf
      eir@cis.upenn.edu authored
      It turns out that there were some pretty egregious mistakes
      in the code that suggested -fprint-explicit-kinds, which are
      fixed. This commit also reorders a bunch of error messages,
      which I think is an improvement.
      
      This also adds the test case for #11471, which is what
      triggered the cleanup in TcErrors. Now that #11473 is done,
      there is nothing more outstanding for #11471.
      
      test case: dependent/should_fail/T11471
      5d98b8bf
  5. 15 Mar, 2016 2 commits
  6. 29 Feb, 2016 2 commits
  7. 26 Feb, 2016 1 commit
  8. 25 Feb, 2016 3 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
    • thomie's avatar
      Testsuite: delete empty files [skip ci] · 9b49c65f
      thomie authored
      9b49c65f
    • Ryan Scott's avatar
      Add more type class instances for GHC.Generics · 673efccb
      Ryan Scott authored
      GHC.Generics provides several representation data types that have
      obvious instances of various type classes in base, along with various
      other types of meta-data (such as associativity and fixity).
      Specifically, instances have been added for the following type classes
      (where possible):
      
          - Applicative
          - Data
          - Functor
          - Monad
          - MonadFix
          - MonadPlus
          - MonadZip
          - Foldable
          - Traversable
          - Enum
          - Bounded
          - Ix
          - Generic1
      
      Thanks to ocharles for starting this!
      
      Test Plan: Validate
      
      Reviewers: ekmett, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1937
      
      GHC Trac Issues: #9043
      673efccb
  9. 23 Feb, 2016 3 commits
  10. 17 Feb, 2016 2 commits
    • eir@cis.upenn.edu's avatar
      Fix #11313. · a6152159
      eir@cis.upenn.edu authored
      Previously, we looked through synonyms when counting arguments,
      but that's a bit silly.
      a6152159
    • thomie's avatar
      Testsuite: delete compiler_lt/le/gt/ge setup functions · 6f25fb32
      thomie authored
      Since we're not consisently keeping track of which tests should pass
      with which compiler versions, there is no point in keeping these
      functions.
      
      Update submodules containers, hpc and stm.
      6f25fb32
  11. 16 Feb, 2016 1 commit
    • Yuras's avatar
      Suggest candidate instances in error message · 5fc06b97
      Yuras authored
      See Trac #9611. In "No instance..." error message we suggest instances
      for other types with the same occ name. It is usefull e.g. when we have
      two different versions of the same package installed.
      
      Test Plan: typecheck/should_fail/tcfail224
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1919
      
      GHC Trac Issues: #9611
      5fc06b97
  12. 15 Feb, 2016 2 commits
    • Simon Peyton Jones's avatar
      Comments only · bb7f2308
      Simon Peyton Jones authored
      bb7f2308
    • Simon Peyton Jones's avatar
      Improve error message suppression · 18cd7124
      Simon Peyton Jones authored
      TcErrors has a system for suppressing some type errors if a more
      serious one occurs.  But there was a crucial missing case, which
      sometimes resulted in a cascade of irrelevant errors overwhelming
      the actual cause. This was Trac #11541.
      
      The fix is simple.  Worth merging to 8.0
      18cd7124
  13. 12 Feb, 2016 1 commit
  14. 10 Feb, 2016 1 commit
  15. 09 Feb, 2016 2 commits
  16. 08 Feb, 2016 3 commits
    • Simon Peyton Jones's avatar
      Fix a nasty superclass expansion bug · 43e02d12
      Simon Peyton Jones authored
      This patch fixes Trac #11523.
      
      * The basic problem was that TcRnTypes.superClassesMightHelp was
        returning True of a Derived constraint, and that led to us
        expanding Given superclasses, which produced the same Derived
        constraint again, and so on infinitely.  We really want to do
        this only if there are unsolve /Wanted/ contraints!
      
      * On the way I made TcSMonad.getUnsolvedInerts a bit more
        discriminating about which Derived equalities it returns;
        see Note [Unsolved Derived equalities] in TcSMonad
      
      * Lots of new comments in TcSMonad.
      43e02d12
    • Simon Peyton Jones's avatar
      Add comments to TcCoercibleFail · a96c4e7c
      Simon Peyton Jones authored
      Flag up the problem highlighted in Trac #11518 comment:15
      a96c4e7c
    • Simon Peyton Jones's avatar
      Allow foralls in instance decls · 2cf3cac6
      Simon Peyton Jones authored
      This patch finally makes it possible to have explicit
      foralls in an instance decl
         instance forall (a :: *). Eq a => Eq [a] where ...
      
      This is useful to allow kind signatures or indeed
      explicicit kind for-alls; see Trac #11519
      
      I thought it would be really easy, because an instance
      declaration already contains an actual HsSigType, so all
      the syntactic baggage is there.  But in fact it turned
      out that instance declarations were kind-checked a
      little differently, because the body kind of the forall
      is 'Constraint' rather than '*'.
      
      So I fixed that.  There a slight kludge
      (see Note [Body kind of a HsQualTy], but it's still a
      significant improvement.
      
      I also did the usual other round of refactoring,
      improved a few error messages, tidied up comments etc.
      The only significant aspect of all that was
      
        * Kill mkNakedSpecSigmaTy, mkNakedPhiTy, mkNakedFunTy
          These function names suggest that they do something
          complicated, but acutally they do nothing. So I
          killed them.
      
        * Swap the arg order of mkNamedBinder, just so that it is
          convenient to say 'map (mkNamedBinder Invisible) tvs'
      
        * I had to improve isPredTy, to deal with (illegal)
          types like
             (Eq a => Eq [a]) => blah
          See Note [isPeredTy complications] in Type.hs
      
      Still to come: user manual documentation for the
      instance-decl change.
      2cf3cac6
  17. 06 Feb, 2016 1 commit
    • Eric Seidel's avatar
      Add a derived `Show SrcLoc` instance · 38af3d1d
      Eric Seidel authored
      Test Plan:
      ```
      ghci> import GHC.Stack
      ghci> SrcLoc "f" "b" "c" 1 2 3 4
      SrcLoc {srcLocPackage = "f", srcLocModule = "b", srcLocFile = "c",
      srcLocStartLine = 1, srcLocStartCol = 2, srcLocEndLine = 3,
      srcLocEndCol = 4}
      ```
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Projects: #ghc
      
      Differential Revision: https://phabricator.haskell.org/D1886
      
      GHC Trac Issues: #11510
      38af3d1d
  18. 27 Jan, 2016 1 commit
    • eir@cis.upenn.edu's avatar
      Refactor the typechecker to use ExpTypes. · 00cbbab3
      eir@cis.upenn.edu authored
      The idea here is described in [wiki:Typechecker]. Briefly,
      this refactor keeps solid track of "synthesis" mode vs
      "checking" in GHC's bidirectional type-checking algorithm.
      When in synthesis mode, the expected type is just an IORef
      to write to.
      
      In addition, this patch does a significant reworking of
      RebindableSyntax, allowing much more freedom in the types
      of the rebindable operators. For example, we can now have
      `negate :: Int -> Bool` and
      `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic
      is in tcSyntaxOp.
      
      This addresses tickets #11397, #11452, and #11458.
      
      Tests:
        typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458}
        th/T11452
      00cbbab3
  19. 23 Jan, 2016 1 commit
  20. 21 Jan, 2016 1 commit
    • Simon Peyton Jones's avatar
      Strip casts in checkValidInstHead · b2e6350f
      Simon Peyton Jones authored
      This patch addresses Trac #11464.
      
      The fix is a bit crude (traverse the type to remove CastTys),
      but it's also simple.
      
      See Note [Casts during validity checking] in TcValidity
      b2e6350f
  21. 16 Jan, 2016 1 commit
    • Simon Peyton Jones's avatar
      Fix a number of subtle solver bugs · 9308c736
      Simon Peyton Jones authored
      As a result of some other unrelated changes I found that
      IndTypesPerf was failing, and opened Trac #11408.  There's
      a test in indexed-types/should-compile/T11408.
      
      The bug was that a type like
       forall t. (MT (UL t) (UR t) ~ t) => UL t -> UR t -> Int
      is in fact unambiguous, but it's a bit subtle to prove
      that it is unambiguous.
      
      In investigating, Dimitrios and I found several subtle
      bugs in the constraint solver, fixed by this patch
      
      * canRewrite was missing a Derived/Derived case.  This was
        lost by accident in Richard's big kind-equality patch.
      
      * Interact.interactTyVarEq would discard [D] a ~ ty if there
        was a [W] a ~ ty in the inert set.  But that is wrong because
        the former can rewrite things that the latter cannot.
        Fix: a new function eqCanDischarge
      
      * In TcSMonad.addInertEq, the process was outright wrong for
        a Given/Wanted in the (GWModel) case.  We were adding a new
        Derived without kicking out things that it could rewrite.
        Now the code is simpler (no special GWModel case), and works
        correctly.
      
      * The special case in kickOutRewritable for [W] fsk ~ ty,
        turns out not to be needed.  (We emit a [D] fsk ~ ty which
        will do the job.
      
      I improved comments and documentation, esp in TcSMonad.
      9308c736
  22. 15 Jan, 2016 2 commits
  23. 14 Jan, 2016 2 commits
  24. 09 Jan, 2016 1 commit
  25. 07 Jan, 2016 1 commit
    • Simon Peyton Jones's avatar
      Turn AThing into ATcTyCon, in TcTyThing · a5cea73c
      Simon Peyton Jones authored
      This change tidies up and simplifies (a bit) the knot-tying
      when kind-checking groups of type and class declarations.
      
      The trouble (shown by Trac #11356) was that we wanted an error message
      (a kind-mismatch) that involved a type mentioned a (AThing k), which
      blew up.
      
      Since we now seem to have TcTyCons, I decided to use them here.
      It's still not great, but it's easier to understand and more robust.
      a5cea73c