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 /rts | |
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 'rts')
0 files changed, 0 insertions, 0 deletions