1. 14 Sep, 2017 21 commits
    • Richard Eisenberg's avatar
      Test #13938, with expect_broken · 86e1db7d
      Richard Eisenberg authored
      test case: dependent/should_compile/T13938
      86e1db7d
    • Richard Eisenberg's avatar
      Fix #13929 by adding another levity polymorphism check · fa626f3b
      Richard Eisenberg authored
      test case: typecheck/should_fail/T13929
      fa626f3b
    • Richard Eisenberg's avatar
      Make rejigConRes do kind substitutions · e5beb6ec
      Richard Eisenberg authored
      This was a lurking bug discovered on the hunt for #13910, but
      it doesn't fix that bug. The old version of rejigConRes was
      just wrong, forgetting to propagate a kind-change.
      e5beb6ec
    • Richard Eisenberg's avatar
      Fix #13909 by tweaking an error message. · 89c8d4d2
      Richard Eisenberg authored
      GHC was complaining about numbers of arguments when the real
      problem is impredicativity.
      
      test case: typecheck/should_fail/T13909
      89c8d4d2
    • Ben Gamari's avatar
      testsuite: Fix dependence on grep behavior in T8129 · 3edbf5c6
      Ben Gamari authored
      grep was considering the output to be binary on my machine, resulting in a
      spurious test failure.
      3edbf5c6
    • Ben Gamari's avatar
      Bump primitive submodule · 58f1f733
      Ben Gamari authored
      58f1f733
    • Ben Gamari's avatar
      nativeGen: A few strictness fixes · ecb316c4
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: austin, simonmar
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3948
      ecb316c4
    • Richard Eisenberg's avatar
      Fix #13407 by suppressing invisibles better. · 04bb8736
      Richard Eisenberg authored
      Previously, the iface-invisible-suppresser assumed that all
      invisible things are up front. Not true!
      
      test case: ghci/scripts/T13407
      04bb8736
    • Richard Eisenberg's avatar
      b9776308
    • Richard Eisenberg's avatar
      Regression test for #12742 · c813d8c9
      Richard Eisenberg authored
      Location: dependent/should_compile/T12742
      c813d8c9
    • Richard Eisenberg's avatar
      3b686879
    • Simon Peyton Jones's avatar
      Add test for Trac #14232 · 93da9f95
      Simon Peyton Jones authored
      93da9f95
    • niteria's avatar
      [RTS] Make -po work · b6b56dd1
      niteria authored
      db2a6676 added `-po` option, but
      the part that parses it was missing.
      
      Test Plan:
      On a simple file:
      ```
      ./inplace/bin/ghc-stage2 A.hs -prof -main-is A; ./A +RTS -P -potest
      ```
      produced test.prof file and didn't produce A.prof file.
      
      ```
      ./A +RTS -P
      ```
      produced A.prof file
      
      Reviewers: simonmar, bgamari, austin, erikd
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3946
      b6b56dd1
    • Simon Peyton Jones's avatar
      Remove unused variable binding · 9e46167f
      Simon Peyton Jones authored
      9e46167f
    • 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
    • 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
      10a1a478
    • 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
      4cead3c1
    • 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
      4e222203
    • 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
      4be195e7
    • 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
      f9bf621c
    • Alan Zimmerman's avatar
      Option "-ddump-rn-ast" dumps imports and exports too · 2fe6f6ba
      Alan Zimmerman authored
      Summary:
      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
      2fe6f6ba
    • Chris Martin's avatar
      Add non-ASCII isLetter True example · 6139f7f7
      Chris Martin authored
      6139f7f7
    • Dmitry Ivanov's avatar
      Fix @since annotations in GHC.Stats · 8ff11c4e
      Dmitry Ivanov authored
      8ff11c4e
    • 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
      cbd49117
    • 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
      e62391a7
    • 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
      91262e75
    • 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
      f8e383f0
    • Ben Gamari's avatar
      DriverMkDepend: Kill redundant import · d645e441
      Ben Gamari authored
      Reviewers: austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3941
      d645e441
    • 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
      b890e88d
    • Ryan Scott's avatar
      Add regression test for #14209 · dafa0128
      Ryan Scott authored
      Summary:
      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
      dafa0128
    • Ryan Scott's avatar
      Check if -XStaticPointers is enabled when renaming static expressions · 9ff9c358
      Ryan Scott authored
      Summary:
      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
      9ff9c358
  3. 12 Sep, 2017 3 commits