diff options
author | Andrei Borzenkov <andreyborzenkov2002@gmail.com> | 2023-01-26 15:04:47 +0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-27 05:02:07 -0500 |
commit | 2648c09cd3caefbcb5febd41867347b81cd94e47 (patch) | |
tree | acb584371962e2c0da04c708a11eab0b91f66928 /testsuite/tests/th | |
parent | e480fbc2c6fdcb252847fc537ab7ec50d1dc2dfd (diff) | |
download | haskell-2648c09cd3caefbcb5febd41867347b81cd94e47.tar.gz |
Replace errors from badOrigBinding with new one (#22839)
Problem: in 02279a9c the type-level [] syntax was changed from a built-in name
to an alias for the GHC.Types.List constructor. badOrigBinding assumes that if
a name is not built-in then it must have come from TH quotation, but this is
not necessarily the case with [].
The outdated assumption in badOrigBinding leads to incorrect error messages.
This code:
data []
Fails with "Cannot redefine a Name retrieved by a Template Haskell quote: []"
Unfortunately, there is not enough information in RdrName to directly determine
if the name was constructed via TH or by the parser, so this patch changes the
error message instead.
It unifies TcRnIllegalBindingOfBuiltIn and TcRnNameByTemplateHaskellQuote
into a new error TcRnBindingOfExistingName and changes its wording to avoid
guessing the origin of the name.
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r-- | testsuite/tests/th/T13968.stderr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/th/T13968.stderr b/testsuite/tests/th/T13968.stderr index 95be60b0b1..fb6f967ede 100644 --- a/testsuite/tests/th/T13968.stderr +++ b/testsuite/tests/th/T13968.stderr @@ -1,3 +1,3 @@ -T13968.hs:6:2: error: [GHC-40027] - Cannot redefine a Name retrieved by a Template Haskell quote: succ +T13968.hs:6:2: error: [GHC-58805] + Illegal binding of an existing name: succ |