1. 28 Mar, 2017 3 commits
  2. 27 Mar, 2017 5 commits
    • Richard Eisenberg's avatar
      Fix #13458 · cea71418
      Richard Eisenberg authored
      Core Lint shouldn't check representations of types that don't
      have representations.
      
      test case: typecheck/should_compile/T13458
      cea71418
    • Simon Peyton Jones's avatar
      Fix 'unsolved constraints' in GHCi · feca929b
      Simon Peyton Jones authored
      In initTc, if the computation fails with an exception, we
      should not complain about unsolved constraints.
      
      Fixes Trac #13466.
      feca929b
    • Simon Peyton Jones's avatar
      Fix error-message suppress on given equalities · e0ad55f8
      Simon Peyton Jones authored
      I'd got the logic slightly wrong when reporting type errors
      for insoluble 'given' equalities.  We suppress insoluble givens
      under some circumstances (see Note [Given errors]), but we then
      suppressed subsequent 'wanted' errors because the (suppressed)
      'given' error "won".  Result: no errors at all :-(.
      
      This patch fixes it and
       - Renames TcType.isTyVarUnderDatatype to the more
         perspicuous TcType.isInsolubleOccursCheck
      
      In doing this I realise that I don't understand why we need
      to keep the insolubles partitioned out separately at all...
      but that is for another day.
      e0ad55f8
    • Simon Peyton Jones's avatar
      Fix explicitly-bidirectional pattern synonyms · 7c7479d0
      Simon Peyton Jones authored
      This partly fixes Trac #13441, at least for the explicitly
      bidirectional case.
      
      See Note [Checking against a pattern signature], the part about
      "Existential type variables".
      
      Alas, the implicitly-bidirectional case is still not quite right, but
      at least there is a workaround by making it explicitly bidirectional.
      7c7479d0
    • Matthew Pickering's avatar
      Only use locally bound variables in pattern synonym declarations · d819e416
      Matthew Pickering authored
      Summary:
      We were using the unconstrainted `lookupOccRn` function which looked up
      any variable in scope. Instead we only want to consider variables brought into
      scope by renaming the pattern on the RHS.
      
      A few more changes to make reporting of unbound names suggest the correct
      things.
      
      Fixes #13470
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3377
      d819e416
  3. 26 Mar, 2017 7 commits
  4. 24 Mar, 2017 4 commits
  5. 22 Mar, 2017 1 commit
  6. 20 Mar, 2017 1 commit
    • Edward Z. Yang's avatar
      Correctly account for -package-db ordering when picking packages. · e0eaea91
      Edward Z. Yang authored
      Summary:
      When I originally implemented ABI-based shadowing as per
      ee4e1654
      
      , I switched our strategy
      from pasting together lists to creating a map of all units first,
      and then selecting packages from this.  However, what I did
      not realize when doing this was that we actually depended
      on the *ordering* of these lists later, when we selected
      a preferred package to use.
      
      The crux is if I have -package-db db1 -package-db db2 -package p-0.1,
      and p-0.1 is provided by both db1 and db2, which one does the
      -package flag select?  Previously, this was undetermined; now
      we always select the instance from the LATEST package database.
      (If p-0.1 shows up multiple times in the same database, once again
      the chosen package is undefined.)
      
      The reason why cabal08 intermittently failed was that, in practice,
      we were sorting on the UnitId, so when we bumped version numbers,
      that often wibbled the UnitIds so that they compared oppositely.
      I've extended the test so that we check that the relation is
      antisymmetric.
      
      Fixes #13313
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3369
      e0eaea91
  7. 17 Mar, 2017 7 commits
    • Simon Peyton Jones's avatar
      No join-point from an INLINE function with wrong arity · a7dbafe9
      Simon Peyton Jones authored
      The main payload of this patch is NOT to make a join-point
      from a function with an INLINE pragma and the wrong arity;
      see Note [Join points and INLINE pragmas] in CoreOpt.
      This is what caused Trac #13413.
      
      But we must do the exact same thing in simpleOptExpr,
      which drove me to the following refactoring:
      
      * Move simpleOptExpr and simpleOptPgm from CoreSubst to a new
        module CoreOpt along with a few others (exprIsConApp_maybe,
        pushCoArg, etc)
      
        This eliminates a module loop altogether (delete
        CoreArity.hs-boot), and stops CoreSubst getting too huge.
      
      * Rename Simplify.matchOrConvertToJoinPoint
           to joinPointBinding_maybe
        Move it to the new CoreOpt
        Use it in simpleOptExpr as well as in Simplify
      
      * Define CoreArity.joinRhsArity and use it
      a7dbafe9
    • Richard Eisenberg's avatar
      66d174a9
    • Richard Eisenberg's avatar
      Remove solveSomeEqualities · 3cfee57a
      Richard Eisenberg authored
      I had thought that it was necessary to solve kind-level equalities
      before validity-checking a type, but I was wrong. This patch simply
      deletes code. Hooray!
      3cfee57a
    • Richard Eisenberg's avatar
      Fix #13343 by not defaulting SigTvs · 02cc8f0c
      Richard Eisenberg authored
      test case: typecheck/should_compile/T13343
      02cc8f0c
    • Richard Eisenberg's avatar
      Fix #13202 by failing more eagerly in tcRnStmt · fa13c136
      Richard Eisenberg authored
      test cases: ghci/scripts/T13202{,a}
      fa13c136
    • Richard Eisenberg's avatar
      Fix #12709 by not building bad applications · dca44adb
      Richard Eisenberg authored
      In an effort to report multiple levity polymorphism errors all at
      once, the desugarer does not fail when encountering bad levity
      polymorphism. But we must be careful not to build the bad applications,
      lest they try to satisfy the let/app invariant and call
      isUnliftedType on a levity polymorphic type. This protects calls
      to mkCoreAppDs appropriately.
      
      test case: typecheck/should_fail/T12709
      dca44adb
    • Edward Z. Yang's avatar
      Save renamed syntax when signature merging. · b301f78e
      Edward Z. Yang authored
      
      
      Summary:
      This is required to make Haddock work correctly.
      
      Comes with a Haddock submodule update for better rendering.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3335
      b301f78e
  8. 15 Mar, 2017 2 commits
    • Ben Gamari's avatar
      Bump hsc2hs submodule · cec90709
      Ben Gamari authored
      Fixes #13388. Also updates the expected output for T12504, which
      previously contained a redundant LINE pragma.
      cec90709
    • Ben Gamari's avatar
      testsuite: Bump margin of T4029 to 15% · 899fb880
      Ben Gamari authored
      This test has been fluctuating wildly recently. Moreover, it's not even clear to
      me that this is a particularly useful thing to be testing.
      899fb880
  9. 14 Mar, 2017 6 commits
    • Richard Eisenberg's avatar
      Fix #13337. · e0c433c8
      Richard Eisenberg authored
      The big change is the introduction of solveSomeEqualities. This
      is just like solveEqualities, but it doesn't fail if there are unsolved
      equalities when it's all done. Anything unsolved is re-emitted. This
      is appropriate if we are not kind-generalizing, so this new form
      is used when decideKindGeneralizationPlan says not to.
      
      We initially thought that any use of solveEqualities would be tied
      to kind generalization, but this isn't true. For example, we need
      to solveEqualities a bunch in the "tc" pass in TcTyClsDecls (which
      is really desugaring). These equalities are all surely going to be
      soluble (if they weren't the "kc" pass would fail), but we still
      need to solve them again. Perhaps if the "kc" pass produced type-
      checked output that is then desugared, solveEqualities really would
      be tied only to kind generalization.
      
      Updates haddock submodule.
      
      Test Plan: ./validate, typecheck/should_compile/T13337
      
      Reviewers: simonpj, bgamari, austin
      
      Reviewed By: simonpj
      
      Subscribers: RyanGlScott, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3315
      e0c433c8
    • Ryan Scott's avatar
      Allow associated types to pattern-match in non-class-bound variables · 67345ccf
      Ryan Scott authored
      Summary:
      After 8136a5cb (#11450), if you have
      a class with an associated type:
      
      ```
      class C a where
        type T a b
      ```
      
      And you try to create an instance of `C` like this:
      
      ```
      instance C Int where
        type T Int Char = Bool
      ```
      
      Then it is rejected, since you're trying to instantiate the variable ``b`` with
      something other than a type variable. But this restriction proves quite
      onerous in practice, as it prevents you from doing things like this:
      
      ```
      class C a where
        type T a (b :: Identity c) :: c
      
      instance C Int where
        type T Int ('Identity x) = x
      ```
      
      You have to resort to an auxiliary type family in order to define this now,
      which becomes extremely tiring. This lifts this restriction and fixes #13398,
      in which it was discovered that adding this restriction broke code in the wild.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, bgamari, austin
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3302
      67345ccf
    • Ben Gamari's avatar
      testsuite: Bump allocations for T4029 · 34f9172f
      Ben Gamari authored
      Both the OS X build machine and my local builds have been failing.
      Unfortunately, our x86_64 Linux machine has been succeeding.
      34f9172f
    • Ben Gamari's avatar
      Introduce and use mkLetRec, mkLetNonRec · 1217df48
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3303
      1217df48
    • Simon Peyton Jones's avatar
      Fix CaseIdentity optimisation AGAIN · 82b40598
      Simon Peyton Jones authored
      In this commit
          commit 02ac2974
          Author: Simon Peyton Jones <simonpj@microsoft.com>
          Date:   Wed Nov 16 10:37:47 2011 +0000
      
          Fix CaseIdentity optimisaion
      
          In fixing one bug I'd introduced another;
             case x of { T -> T; F -> F }
          wasn't getting optmised!  Trivial to fix.
      
      I introduced yet another!  This line of code in SimplUtils.mkCase1
      
          check_eq (Var v)    (DataAlt con) []   = v == dataConWorkId con
                                                   -- Optimisation only
      
      is patently false when arg_tys is non-empty.  Astonishing that it
      has not shown up before now.
      
      Easily fixed though.  This was all shown up by Trac #13417, which is
      now fixed.
      
      Merge to 8.0, 8.2.
      82b40598
    • Gabor Greif's avatar
      Typos in manual and comments · 50512c6b
      Gabor Greif authored
      50512c6b
  10. 13 Mar, 2017 4 commits