1. 14 Sep, 2017 6 commits
    • 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
    • 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.
    • 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.
    • 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.
    • Simon Peyton Jones's avatar
      More refinements to debugPprType · ab2d3d5d
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      No need to check ambiguity for visible type args · 959a623e
      Simon Peyton Jones authored
      Seems unnecesarry to me.
  2. 13 Sep, 2017 16 commits
    • Ben Gamari's avatar
      Model divergence of retry# as ThrowsExn, not Diverges · 10a1a478
      Ben Gamari authored
      The demand signature of the retry# primop previously had a Diverges
      result.  However, this caused the demand analyser to conclude that a
      program of the shape,
          catchRetry# (... >> retry#)
      would diverge. Of course, this is plainly wrong; catchRetry#'s sole
      reason to exist is to "catch" the "exception" thrown by retry#. While
      catchRetry#'s demand signature correctly had the ExnStr flag set on its
      first argument, indicating that it should catch divergence, the logic
      associated with this flag doesn't apply to Diverges results. This
      resulted in #14171.
      The solution here is to treat the divergence of retry# as an exception.
      Namely, give it a result type of ThrowsExn rather than Diverges.
      Updates stm submodule for tests.
      Test Plan: Validate with T14171
      Reviewers: simonpj, austin
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14171, #8091
      Differential Revision: https://phabricator.haskell.org/D3919
    • Ben Gamari's avatar
      rts: Add regsterCc(s)List to RTS symbols list · 4cead3c1
      Ben Gamari authored
      These are helpers added in a8da0de2 to
      register cost centres. They are invoked while loading profiled code and
      therefore need to be in the RTS's symbol list.
      Test Plan: Validate, trying starting GHCi in profiled GHC build
      Reviewers: austin, erikd, simonmar
      Subscribers: rwbarton, thomie, RyanGlScott
      Differential Revision: https://phabricator.haskell.org/D3950
    • Sibi Prabakaran's avatar
      Clarify seq documentation · 4e222203
      Sibi Prabakaran authored
      Improves the documentation by specifying that the first argument in
      seq function is evaluated to WHNF.
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: harendra, rwbarton, thomie
      GHC Trac Issues: #14213
      Differential Revision: https://phabricator.haskell.org/D3945
    • David Feuer's avatar
      Simplify Data.Type.Equality.== · 4be195e7
      David Feuer authored
      Contrary to previous comments, we can calculate `==` for types
      in an extremely general fashion. The approach used here is actually
      the one mistakenly rejected as impossible. There will be some cases
      when the previous version was able to reduce and this one is not,
      particularly for types in `*` that are unknown, but known equal.
      However, the new behavior is much more uniform. Within the
      established framework of equality testing by pattern matching,
      it does a better job than the previous version.
      Reviewers: goldfire, austin, hvr, bgamari, RyanGlScott
      Reviewed By: RyanGlScott
      Subscribers: RyanGlScott, rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3835
    • Ben Gamari's avatar
      Better document TypeRep patterns · f9bf621c
      Ben Gamari authored
      As pointed out in #14199 these are rather non-trivial; extra
      documentation is in order.
      [skip ci]
      Test Plan: Read it
      Reviewers: dfeuer, austin, hvr
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14199
      Differential Revision: https://phabricator.haskell.org/D3943
    • Alan Zimmerman's avatar
      Option "-ddump-rn-ast" dumps imports and exports too · 2fe6f6ba
      Alan Zimmerman authored
      Previously the renamed source decls only were dumped, now the imports, exports
      and doc_hdr are too.
      Test Plan: ./validate
      Reviewers: bgamari, austin
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14197
      Differential Revision: https://phabricator.haskell.org/D3949
    • Chris Martin's avatar
      Add non-ASCII isLetter True example · 6139f7f7
      Chris Martin authored
    • Dmitry Ivanov's avatar
      Fix @since annotations in GHC.Stats · 8ff11c4e
      Dmitry Ivanov authored
    • Tao He's avatar
      Make IntPtr and WordPtr as instance of Data.Data typeclass, fix #13115 · cbd49117
      Tao He authored
      Test Plan: ./validate
      Reviewers: austin, hvr, bgamari, RyanGlScott
      Reviewed By: RyanGlScott
      Subscribers: RyanGlScott, rwbarton, thomie
      GHC Trac Issues: #13115
      Differential Revision: https://phabricator.haskell.org/D3938
    • niteria's avatar
      [RTS] Harden against buffer overflow · e62391a7
      niteria authored
      This sprintf is safe thanks to the guarantees on the format strings that
      we pass to it.  Well, almost. The GR_FILENAME_FMT_GUM format would not
      have satisfied them if it was still used.
      If someone makes a mistake that's a potential privilege escalation,
      so I think it's reasonable to switch to snprintf to protect against
      that remote possibility.
      Test Plan: it builds, CI
      Reviewers: simonmar, bgamari, austin, erikd
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3944
    • Moritz Angermann's avatar
      Use ar for -staticlib · 91262e75
      Moritz Angermann authored
      Hopefully we can get rid of libtool, by using ar only
      Depends on:  D3579
      Test Plan: validate
      Reviewers: austin, hvr, bgamari, erikd
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, erikd
      Differential Revision: https://phabricator.haskell.org/D3721
    • David Feuer's avatar
      Clarify Data.Data documentation · f8e383f0
      David Feuer authored
      Explain much more clearly when `dataCast1` and `dataCast2` can
      have non-trivial implementations. On a couple different occasions,
      I have attempted to write better defaults for these, only to
      discover that we can't really do that. The new documentation
      implicitly explains why that is.
      [skip ci]
      Reviewers: austin, hvr, bgamari, angerman
      Reviewed By: bgamari, angerman
      Subscribers: angerman, rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3926
    • Ben Gamari's avatar
      DriverMkDepend: Kill redundant import · d645e441
      Ben Gamari authored
      Reviewers: austin
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3941
    • Ben Gamari's avatar
      rts: Print message before SIGUSR2 backtrace · b890e88d
      Ben Gamari authored
      Reviewers: austin, erikd, simonmar
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3942
    • Ryan Scott's avatar
      Add regression test for #14209 · dafa0128
      Ryan Scott authored
      Commit 0257dacf
      (`Refactor bindHsQTyVars and friends`) ended up fixing #14209. Let's
      add a regression test so that it stays fixed.
      Test Plan: make test TEST=T14209
      Reviewers: austin, bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14209
      Differential Revision: https://phabricator.haskell.org/D3936
    • Ryan Scott's avatar
      Check if -XStaticPointers is enabled when renaming static expressions · 9ff9c358
      Ryan Scott authored
      Trying to use `static` expressions without the `-XStaticPointers`
      extension enabled can lead to runtime errors. Normally, such a situation isn't
      possible, but Template Haskell provides a backdoor that allows it to happen,
      as shown in #14204.
      To prevent this, we ensure that `-XStaticPointers` is enabled when renaming
      `static` expressions.
      Test Plan: make test TEST=T14204
      Reviewers: facundominguez, austin, bgamari, simonpj
      Reviewed By: facundominguez, simonpj
      Subscribers: simonpj, rwbarton, thomie
      GHC Trac Issues: #14204
      Differential Revision: https://phabricator.haskell.org/D3931
  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
    • 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
    • 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
  6. 07 Sep, 2017 4 commits
  7. 06 Sep, 2017 1 commit