diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2021-10-14 18:57:54 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-24 01:27:57 -0400 |
commit | 3417a81a34fdf74857138a105b2ab4ee32e658c4 (patch) | |
tree | 22e4f7228512698fa93bc093d463be96f7ad6939 /testsuite/tests/simplCore | |
parent | 691c450f1e9cc3fd83b662be3c0134fde03e97db (diff) | |
download | haskell-3417a81a34fdf74857138a105b2ab4ee32e658c4.tar.gz |
undefined: Neater CallStack in error message
Users of `undefined` don’t want to see
```
files.hs: Prelude.undefined:
CallStack (from HasCallStack):
error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
undefined, called at file.hs:151:19 in main:Main
```
but want to see
```
files.hs: Prelude.undefined:
CallStack (from HasCallStack):
undefined, called at file.hs:151:19 in main:Main
```
so let’s make that so.
The function for that is `withFrozenCallStack`, but that is not usable
here (module dependencies, and also not representation-polymorphic). And
even if it were, it could confuse GHC’s strictness analyzer, leading to
big regressions in some perf tests (T10421 in particular).
So after shuffling modules and definitions around, I eventually noticed
that the easiest way is to just not call `error` here.
Fixes #19886
Diffstat (limited to 'testsuite/tests/simplCore')
-rw-r--r-- | testsuite/tests/simplCore/should_fail/T7411.stderr | 3 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/T16893/T16893.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/T5625.stderr | 3 |
3 files changed, 2 insertions, 5 deletions
diff --git a/testsuite/tests/simplCore/should_fail/T7411.stderr b/testsuite/tests/simplCore/should_fail/T7411.stderr index 6fc6a22560..9a72acaf2c 100644 --- a/testsuite/tests/simplCore/should_fail/T7411.stderr +++ b/testsuite/tests/simplCore/should_fail/T7411.stderr @@ -1,4 +1,3 @@ T7411: Prelude.undefined -CallStack (from ImplicitParams): - error, called at libraries/base/GHC/Err.hs:43:14 in base:GHC.Err +CallStack (from HasCallStack): undefined, called at T7411.hs:3:25 in main:Main diff --git a/testsuite/tests/simplCore/should_run/T16893/T16893.stderr b/testsuite/tests/simplCore/should_run/T16893/T16893.stderr index 5dfa1d642f..c077f4bed1 100644 --- a/testsuite/tests/simplCore/should_run/T16893/T16893.stderr +++ b/testsuite/tests/simplCore/should_run/T16893/T16893.stderr @@ -1,4 +1,3 @@ T16893: Prelude.undefined CallStack (from HasCallStack): - error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err undefined, called at ./Complex.hs:47:28 in main:Complex diff --git a/testsuite/tests/simplCore/should_run/T5625.stderr b/testsuite/tests/simplCore/should_run/T5625.stderr index fe02e7e6a8..a935ab7af8 100644 --- a/testsuite/tests/simplCore/should_run/T5625.stderr +++ b/testsuite/tests/simplCore/should_run/T5625.stderr @@ -1,4 +1,3 @@ T5625: Prelude.undefined -CallStack (from ImplicitParams): - error, called at libraries/base/GHC/Err.hs:43:14 in base:GHC.Err +CallStack (from HasCallStack): undefined, called at T5625.hs:3:31 in main:Main |