1. 14 Sep, 2017 7 commits
    • Simon Peyton Jones's avatar
      Interim fix for a nasty type-matching bug · 9218ea60
      Simon Peyton Jones authored
      The type matcher in types/Unify.hs was producing a substitution
      that had variables from the template in its range.  Yikes!
      
      This patch, documented in Note [Matching in the presence of casts],
      is an interm fix.  Richard and I don't like it much, and are
      pondering a better solution (Trac #14119).
      
      All this came up in investigating Trac #13910. Alas this patch
      doesn't fix #13910, which still has ASSERT failures, so I have
      not yet added a test.  But the patch does fix a definite bug.
      9218ea60
    • Simon Peyton Jones's avatar
      Refactor tcInferApps · a38acda6
      Simon Peyton Jones authored
      This is a simple refactor
      
      * Remove an unnecessary accumulating argument (acc_hs_apps) from
        the 'go' function
      
      * And put 'n' first in the same function
      a38acda6
    • Simon Peyton Jones's avatar
      Refactor to eliminate FamTyConShape · 0390e4a0
      Simon Peyton Jones authored
      Consider this note (TcTyClsDecls)
      
        Note [Type-checking type patterns]
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        When typechecking the patterns of a family instance declaration, we can't
        rely on using the family TyCon itself, because this is sometimes called
        from within a type-checking knot. (Specifically for closed type families.)
        The FamTyConShape gives just enough information to do the job.
      
      I realised that this exact purpose can be served by TcTyCons, and
      in fact rather better.  So this patch
      
      * Refactors FamTyConShape out of existence, replacing it with TcTyCOn
      
      * I also got rid Type.filterOutInvisibleTyVars, which was a very
        complex way to do something quite simple.  I replaced the calls
        with TyCon.tyConVisibleTyVars.
      
      No change in behaviour.
      0390e4a0
    • Simon Peyton Jones's avatar
      Tidying could cause ill-kinded types · 8bf865d3
      Simon Peyton Jones authored
      I found (Trac #14175) that the tidying we do when reporting
      type error messages could cause a well-kinded type to become
      ill-kinded. Reason: we initialised the tidy-env with a
      completely un-zonked TidyEnv accumulated in the TcLclEnv
      as we come across lexical type-varialbe bindings.
      
      Solution: zonk them.
      
      But I ended up refactoring a bit:
      
      * Get rid of tcl_tidy :: TidyEnv altogether
      
      * Instead use tcl_bndrs :: TcBinderStack
        This used to contain only Ids, but now I've added those
        lexically scoped TyVars too.
      
      * Change names:
           TcIdBinderStack -> TcBinderStack
           TcIdBinder      -> TcBinder
           extendTcIdBndrs -> extendTcBinderStack
      
      * Now tcInitTidyEnv can grab those TyVars from the
        tcl_bndrs, zonk, and tidy them.
      
      The only annoyance is that I had to add TcEnv.hs-boot, to
      break the recursion between the zonking code and the
      TrRnMonad functions like addErrTc that call tcInitTidyEnv.
      Tiresome, but in fact that file existed already.
      8bf865d3
    • Simon Peyton Jones's avatar
      Fix subtle bug in TcTyClsDecls.mkGADTVars · 3a27e34f
      Simon Peyton Jones authored
      This bug was revealed by Trac #14162.  In a GADT-style data-family
      instance we ended up a data constructor whose type mentioned
      an out-of-scope variable.  (This variable was in the kind of
      a variable in the kind of a variable.)
      
      Only Lint complained about this (actually only when the
      data constructor was injected into the bindings by CorePrep).
      So it doesn't matter much -- but it's a solid bug and might
      bite us some day.
      
      It took me quite a while to unravel because the test case was itself
      quite tricky.  But the fix is easy; just add a missing binding to the
      substitution we are building up.  It's in the regrettably-subtle
      mkGADTVars function.
      3a27e34f
    • Simon Peyton Jones's avatar
      More refinements to debugPprType · ab2d3d5d
      Simon Peyton Jones authored
      ab2d3d5d
    • Simon Peyton Jones's avatar
      No need to check ambiguity for visible type args · 959a623e
      Simon Peyton Jones authored
      Seems unnecesarry to me.
      959a623e
  2. 13 Sep, 2017 16 commits
  3. 12 Sep, 2017 3 commits
  4. 09 Sep, 2017 7 commits
  5. 08 Sep, 2017 3 commits
    • David Feuer's avatar
      Deal with unbreakable blocks in Applicative Do · 011e15aa
      David Feuer authored
      The renamer wasn't able to deal with more than a couple strict
      patterns in a row with `ApplicativeDo` when using the heuristic
      splitter. Update it to work with them properly.
      
      Reviewers: simonmar, austin, bgamari, hvr
      
      Reviewed By: simonmar
      
      Subscribers: RyanGlScott, lippling, rwbarton, thomie
      
      GHC Trac Issues: #14163
      
      Differential Revision: https://phabricator.haskell.org/D3900
      011e15aa
    • Moritz Angermann's avatar
      Drop special handling of iOS and Android · cb4878ff
      Moritz Angermann authored
      As far as GHC is concerned, iOS **is** Darwin, and
      Android **is** Linux.
      
      Depends on D3352
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: Ericson2314, ryantrinkle, rwbarton, thomie, erikd
      
      Differential Revision: https://phabricator.haskell.org/D3579
      cb4878ff
    • Ben Gamari's avatar
      includes/rts: Drop trailing comma · be514a69
      Ben Gamari authored
      This trailing comma snuck in in a recent patch. There is nothing wrong with the
      comma; it's perfectly valid C99, yet nevertheless Mac OS X's dtrace utility
      chokes on it with,
      
          dtrace: failed to compile script rts/RtsProbes.d:
                  "includes/rts/EventLogFormat.h", line 245: syntax error near "}"
          make[1]: *** [rts/dist/build/RtsProbes.h] Error 1
      be514a69
  6. 07 Sep, 2017 4 commits