[commit: ghc] master: Use IP based CallStack in error and undefined (6740d70)

git at git.haskell.org git at git.haskell.org
Wed Sep 2 11:22:46 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6740d70d95cb81cea3859ff847afc61ec439db4f/ghc

>---------------------------------------------------------------

commit 6740d70d95cb81cea3859ff847afc61ec439db4f
Author: Eric Seidel <gridaphobe at gmail.com>
Date:   Wed Sep 2 10:22:01 2015 +0200

    Use IP based CallStack in error and undefined
    
    This patch modifies `error`, `undefined`, and `assertError` to use
    implicit call-stacks to provide better error messages to users.
    
    There are a few knock-on effects:
    
    - `GHC.Classes.IP` is now wired-in so it can be used in the wired-in
      types for `error` and `undefined`.
    
    - `TysPrim.tyVarList` has been replaced with a new function
      `TysPrim.mkTemplateTyVars`. `tyVarList` made it easy to introduce
      subtle bugs when you need tyvars of different kinds. The naive
    
      ```
      tv1 = head $ tyVarList kind1
      tv2 = head $ tyVarList kind2
      ```
    
      would result in `tv1` and `tv2` sharing a `Unique`, thus substitutions
      would be applied incorrectly, treating `tv1` and `tv2` as the same
      tyvar. `mkTemplateTyVars` avoids this pitfall by taking a list of kinds
      and producing a single tyvar of each kind.
    
    - The types `GHC.SrcLoc.SrcLoc` and `GHC.Stack.CallStack` now live in
      ghc-prim.
    
    - The type `GHC.Exception.ErrorCall` has a new constructor
      `ErrorCallWithLocation` that takes two `String`s instead of one, the
      2nd one being arbitrary metadata about the error (but usually the
      call-stack). A bi-directional pattern synonym `ErrorCall` continues to
      provide the old API.
    
    Updates Cabal, array, and haddock submodules.
    
    Reviewers: nh2, goldfire, simonpj, hvr, rwbarton, austin, bgamari
    
    Reviewed By: simonpj
    
    Subscribers: rwbarton, rodlogic, goldfire, maoe, simonmar, carter,
    liyang, bgamari, thomie
    
    Differential Revision: https://phabricator.haskell.org/D861
    
    GHC Trac Issues: #5273


>---------------------------------------------------------------

6740d70d95cb81cea3859ff847afc61ec439db4f
 compiler/basicTypes/MkId.hs                        |  2 +-
 compiler/coreSyn/MkCore.hs                         | 28 +++++---
 compiler/iface/IfaceType.hs                        |  4 +-
 compiler/prelude/PrelNames.hs                      | 27 ++++----
 compiler/prelude/TysPrim.hs                        | 29 +++++----
 compiler/prelude/TysWiredIn.hs                     | 74 ++++++++++++++++++++--
 compiler/typecheck/TcBinds.hs                      |  6 +-
 compiler/typecheck/TcExpr.hs                       | 32 +++-------
 compiler/typecheck/TcHsType.hs                     |  3 +-
 compiler/typecheck/TcInteract.hs                   |  8 +--
 compiler/typecheck/TcTypeNats.hs                   | 10 +--
 compiler/types/Type.hs                             |  6 +-
 compiler/types/TypeRep.hs                          |  2 +-
 docs/users_guide/7.12.1-notes.xml                  | 41 ++++++++----
 docs/users_guide/glasgow_exts.xml                  |  4 +-
 libraries/Cabal                                    |  2 +-
 libraries/array                                    |  2 +-
 libraries/base/Control/Exception.hs                |  3 +-
 libraries/base/Control/Exception/Base.hs           |  3 +-
 libraries/base/GHC/Err.hs                          | 10 +--
 libraries/base/GHC/Exception.hs                    | 57 +++++++++++++++--
 libraries/base/GHC/Exception.hs-boot               |  5 +-
 libraries/base/GHC/IO/Exception.hs                 | 10 +--
 libraries/base/GHC/SrcLoc.hs                       | 40 ------------
 libraries/base/GHC/Stack.hsc                       | 62 +-----------------
 libraries/base/base.cabal                          |  1 -
 libraries/base/tests/assert.stderr                 |  4 +-
 libraries/ghc-prim/GHC/Types.hs                    | 51 ++++++++++++++-
 .../tests/annotations/should_fail/annfail12.stderr |  4 +-
 testsuite/tests/cabal/cabal07/cabal07.stderr       |  5 +-
 testsuite/tests/deriving/should_run/T9576.stderr   |  2 +-
 testsuite/tests/driver/T1372/T1372.stderr          |  1 +
 .../tests/ghci.debugger/scripts/break009.stdout    |  2 +
 .../tests/ghci.debugger/scripts/break011.stdout    | 26 ++++++--
 .../tests/ghci.debugger/scripts/break017.stdout    |  3 +
 testsuite/tests/ghci/scripts/T10501.stderr         |  5 ++
 testsuite/tests/ghci/scripts/T5557.stdout          |  6 ++
 testsuite/tests/ghci/scripts/ghci055.stdout        |  5 +-
 testsuite/tests/perf/compiler/all.T                | 10 ++-
 .../tests/simplCore/should_compile/EvalTest.stdout |  2 +-
 testsuite/tests/simplCore/should_compile/T4930.hs  |  2 +-
 .../tests/simplCore/should_compile/T4930.stderr    | 48 +++++++-------
 testsuite/tests/th/T5358.stderr                    |  2 +
 testsuite/tests/th/T5976.stderr                    |  6 +-
 testsuite/tests/th/T7276a.stdout                   |  6 +-
 testsuite/tests/th/T8987.stderr                    |  5 +-
 testsuite/tests/th/TH_exn2.stderr                  |  8 ++-
 utils/haddock                                      |  2 +-
 48 files changed, 408 insertions(+), 268 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6740d70d95cb81cea3859ff847afc61ec439db4f


More information about the ghc-commits mailing list