diff options
author | sheaf <sam.derbyshire@gmail.com> | 2022-02-25 12:36:02 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-26 02:07:30 -0500 |
commit | 033e9f0fcd0c1f9a2814b6922275514951c87dfd (patch) | |
tree | 2690d9df130d5dfceede94db776ebdbf983846a9 /compiler/GHC/Rename/Expr.hs | |
parent | b80461954e3c52a01d0c1cc7c4087959818dbd08 (diff) | |
download | haskell-033e9f0fcd0c1f9a2814b6922275514951c87dfd.tar.gz |
Error on anon wildcards in tcAnonWildCardOcc
The code in tcAnonWildCardOcc assumed that it could never encounter
anonymous wildcards in illegal positions, because the renamer would
have ruled them out. However, it's possible to sneak past the checks
in the renamer by using Template Haskell. It isn't possible to simply
pass on additional information when renaming Template Haskell
brackets, because we don't know in advance in what context the bracket
will be spliced in (see test case T15433b). So we accept that we might
encounter these bogus wildcards in the typechecker and throw the
appropriate error.
This patch also migrates the error messages for illegal wildcards in
types to use the diagnostic infrastructure.
Fixes #15433
Diffstat (limited to 'compiler/GHC/Rename/Expr.hs')
-rw-r--r-- | compiler/GHC/Rename/Expr.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs index b34581dd8e..6c7a55da1f 100644 --- a/compiler/GHC/Rename/Expr.hs +++ b/compiler/GHC/Rename/Expr.hs @@ -38,7 +38,7 @@ import GHC.Tc.Utils.Monad import GHC.Unit.Module ( getModule, isInteractiveModule ) import GHC.Rename.Env import GHC.Rename.Fixity -import GHC.Rename.Utils ( HsDocContext(..), bindLocalNamesFV, checkDupNames +import GHC.Rename.Utils ( bindLocalNamesFV, checkDupNames , bindLocalNames , mapMaybeFvRn, mapFvRn , warnUnusedLocalBinds, typeAppErr |