1. 28 Sep, 2017 1 commit
    • Simon Marlow's avatar
      mkDataConRep: fix bug in strictness signature (#14290) · a0671e2d
      Simon Marlow authored
      The strictness signature for a data con wrapper wasn't including any
      dictionary arguments, which meant that bangs on the fields of a
      constructor with an existential context would be moved to the wrong
      fields.  See T14290 for an example.
      Test Plan:
      * New test T14290
      * validate
      Reviewers: simonpj, niteria, austin, bgamari, erikd
      Reviewed By: simonpj, bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14290
      Differential Revision: https://phabricator.haskell.org/D4040
      (cherry picked from commit 5935acdb)
  2. 27 Sep, 2017 4 commits
  3. 26 Sep, 2017 5 commits
  4. 19 Sep, 2017 16 commits
    • Ben Gamari's avatar
      Revert "Improve error messages around kind mismatches." · 00c959e6
      Ben Gamari authored
      This reverts commit eb870ae0.
      This reverts commit 6a024a55.
      There was some disagreement in #11198 regarding whether this patch was
      in fact the right solution to the issue at hand.
    • Alan Zimmerman's avatar
      Option "-ddump-rn-ast" dumps imports and exports too · 31bf2003
      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
      (cherry picked from commit 2fe6f6ba)
    • Ben Gamari's avatar
      SetLevels: Substitute in ticks in lvlMFE · 9565e526
      Ben Gamari authored
      Previously SetLevels.lvlMFE would fail to substitute in ticks, unlike
      lvlExpr.  This lead to #13481. Fix this.
      Test Plan: `make test TEST=T12622 WAY=ghci`
      Reviewers: austin, simonpj
      Reviewed By: simonpj
      Subscribers: simonpj, rwbarton, thomie
      GHC Trac Issues: #13481
      Differential Revision: https://phabricator.haskell.org/D3920
      (cherry picked from commit cd857dd4)
    • Ben Gamari's avatar
      rts: Add heap breakdown type for -hT · 3b2fc86a
      Ben Gamari authored
      Test Plan: Build, program with `-eventlog`, try running with `+RTS -h`
      Reviewers: austin, erikd, simonmar
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14096
      Differential Revision: https://phabricator.haskell.org/D3922
      (cherry picked from commit 24e50f98)
    • Ben Gamari's avatar
      eventlog: Clean up profiling heap breakdown type · 46367997
      Ben Gamari authored
      Reviewers: austin, erikd, simonmar
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14096
      Differential Revision: https://phabricator.haskell.org/D3923
      (cherry picked from commit 822abbb1)
    • David Feuer's avatar
      Deal with unbreakable blocks in Applicative Do · 55b27a32
      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
      (cherry picked from commit 011e15aa)
    • Ben Gamari's avatar
      Better document TypeRep patterns · 14195b09
      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
      (cherry picked from commit f9bf621c)
    • Simon Peyton Jones's avatar
      Really fix Trac #14158 · 13cd53df
      Simon Peyton Jones authored
      I dug more into how #14158 started working. I temporarily reverted the
      patch that "fixed" it, namely
          commit a6c448b4
          Author: Simon Peyton Jones <simonpj@microsoft.com>
          Date:   Mon Aug 28 17:33:59 2017 +0100
          Small refactor of getRuntimeRep
      Sure enough, there was a real bug, described in the new
      TcExpr Note [Visible type application zonk]
      In general, syntactic substituion should be kind-preserving!
      Maybe we should check that invariant...
      (cherry picked from commit 2c133b67)
    • Simon Peyton Jones's avatar
      Fix subtle bug in TcTyClsDecls.mkGADTVars · 8fda8ade
      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.
      (cherry picked from commit 3a27e34f)
    • Alan Zimmerman's avatar
      Renamer now preserves location for IEThingWith list items · a153d2f2
      Alan Zimmerman authored
      Prior to this, in the RenamedSource for
          module Renaming.RenameInExportedType
            MyType (NT)
            ) where
          data MyType = MT Int | NT
      The (NT) was given the location of MyType earlier on the line in the
      export list.
      Also the location was discarded for any field labels, and replaced with
      a `noLoc`.
      Test Plan: ./validate
      Reviewers: bgamari, austin
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14189
      Differential Revision: https://phabricator.haskell.org/D3968
      (cherry picked from commit 9498c50e)
    • Ryan Scott's avatar
      Fix #14228 by marking SumPats as non-irrefutable · fb519018
      Ryan Scott authored
      `isIrrefutableHsPat` should always return `False` for unboxed sum
      patterns (`SumPat`s), since they always have at least one other
      corresponding pattern of the same arity (since the minimum arity for a
      `SumPat` is 2). Failure to do so causes incorrect code to be generated
      for pattern synonyms that use unboxed sums, as shown in #14228.
      Test Plan: make test TEST=T14228
      Reviewers: austin, bgamari, simonpj
      Reviewed By: simonpj
      Subscribers: simonpj, rwbarton, thomie
      GHC Trac Issues: #14228
      Differential Revision: https://phabricator.haskell.org/D3951
      (cherry picked from commit f4d50a0e)
    • Ben Gamari's avatar
      Add a Note describing #14128 · 6cf6a69c
      Ben Gamari authored
      I prematurely committed the D3892 before adding a Note. Fix this.
      (cherry picked from commit 6f1ccaa5)
    • Ben Gamari's avatar
      testsuite: Add test for #14128 · 90979616
      Ben Gamari authored
      Reviewers: austin, goldfire
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14128
      Differential Revision: https://phabricator.haskell.org/D3890
      (cherry picked from commit 248ad303)
    • Ben Gamari's avatar
      desugar: Ensure that a module's dep_orphs doesn't contain itself · 609f4854
      Ben Gamari authored
      Consider that we have two modules, A and B, both with hs-boot files,
        * A.hs contains a SOURCE import of B
        * B.hs-boot contains a SOURCE import of A
        * A.hs-boot declares an orphan instance
        * A.hs defines the orphan instance
      In this case, B's dep_orphs will contain A due to its SOURCE import of
      A.  Consequently, A will contain itself in its imp_orphs due to its
      import of B.  This fact would end up being recorded in A's interface
      file. This would then break the invariant asserted by calculateAvails
      that a module does not itself in its dep_orphs. This was the cause
      of #14128.
      The solution is to remove self-references from imp_orphs when
      constructing dep_orphs; we already did a similar thing for dep_mods. I
      believe we should do the same for dep_finsts, although I'm treating this
      as a separate bug.
      Reviewers: austin
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3892
      (cherry picked from commit db3a8e16)
    • Richard Eisenberg's avatar
      Test #11672 in typecheck/should_fail/T11672. · 71724092
      Richard Eisenberg authored
      I believe this was fixed with the fix for #11198.
      (cherry picked from commit 9a549756)
    • Ben Gamari's avatar
      Fix tests · eb870ae0
      Ben Gamari authored
  5. 31 Aug, 2017 1 commit
    • Richard Eisenberg's avatar
      Improve error messages around kind mismatches. · 6a024a55
      Richard Eisenberg authored
      Previously, when canonicalizing (or unifying, in uType) a
      heterogeneous equality, we emitted a kind equality and used the
      resulting coercion to cast one side of the heterogeneous equality.
      While sound, this led to terrible error messages. (See the bugs
      listed below.) The problem is that using the coercion built from
      the emitted kind equality is a bit like a wanted rewriting a wanted.
      The solution is to keep heterogeneous equalities as irreducible.
      See Note [Equalities with incompatible kinds] in TcCanonical.
      This commit also removes a highly suspicious switch to FM_SubstOnly
      when flattening in the kinds of a type variable. I have no idea
      why this was there, other than as a holdover from pre-TypeInType.
      I've not left a Note because there is simply no reason I can conceive
      of that the FM_SubstOnly should be there.
      One challenge with this patch is that the emitted derived equalities
      might get emitted several times: when a heterogeneous equality is
      in an implication and then gets floated out from the implication,
      the Derived is present both in and out of the implication. This
      causes a duplicate error message. (Test case:
      typecheck/should_fail/T7368) Solution: track the provenance of
      Derived constraints and refuse to float out a constraint that has
      an insoluble Derived.
      Lastly, this labels one test (dependent/should_fail/RAE_T32a)
      as expect_broken, because the problem is really #12919. The
      different handling of constraints in this patch exposes the error.
      This fixes bugs #11198, #12373, #13530, and #13610.
      test cases:
      (cherry picked from commit 8e15e3d3)
  6. 29 Aug, 2017 3 commits
    • Tamar Christina's avatar
      Fix decomposition error on Windows · 625bea00
      Tamar Christina authored
      Fix the path decomposition error that occurs when the Symlink resolver
      fails. `Win32.try` throws an exception, so catch it and assume the path
      isn't a symlink to use the old behavior.
      Test Plan: ./validate
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14159
      Differential Revision: https://phabricator.haskell.org/D3891
      (cherry picked from commit 3c6b2fc3)
    • Simon Peyton Jones's avatar
      Small refactor of getRuntimeRep · cbf47238
      Simon Peyton Jones authored
      Instead of using a string argument, use HasDebugCallStack.
      (Oddly, some functions were using both!)
      Plus, use getRuntimeRep rather than getRuntimeRep_maybe when
      if the caller panics on Nothing. Less code, and a better debug
      (cherry picked from commit a6c448b4)
    • Simon Peyton Jones's avatar
      Use a well-kinded substitution to instantiate · d913594f
      Simon Peyton Jones authored
      In tcDataConPat we were creating an ill-kinded substitution
      -- or at least one that is well kinded only after you have solved
      other equalities.  THat led to a crash, because the instantiated
      data con type was ill-kinded.
      This patch guarantees that the instantiating substitution is
      Fixed Trac #14154
      (cherry picked from commit 4455c86d)
  7. 25 Aug, 2017 9 commits
  8. 22 Aug, 2017 1 commit