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/Tc/Module.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/Tc/Module.hs')
-rw-r--r-- | compiler/GHC/Tc/Module.hs | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index 11278d6bc7..aa43b7e4e0 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -91,7 +91,6 @@ import GHC.Tc.Utils.Backpack import GHC.Rename.Splice ( rnTopSpliceDecls, traceSplice, SpliceInfo(..) ) import GHC.Rename.HsType import GHC.Rename.Expr -import GHC.Rename.Utils ( HsDocContext(..) ) import GHC.Rename.Fixity ( lookupFixityRn ) import GHC.Rename.Names import GHC.Rename.Env |