summaryrefslogtreecommitdiff
path: root/compiler/GHC/Runtime
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2021-10-05 18:16:27 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-06 10:58:03 -0400
commita466b02492f73a43c6cb9ce69491fc85234b9559 (patch)
tree6d4f7c1d0ad4609fa1878d44f0e1e20b8c4501ef /compiler/GHC/Runtime
parent9af29e7fa81a8696a2d829a0ecbebcbc8be5badd (diff)
downloadhaskell-a466b02492f73a43c6cb9ce69491fc85234b9559.tar.gz
Improve overlap error for polykinded constraints
There were two problems around `mkDictErr`: 1. An outdated call to `flattenTys` meant that we missed out on some instances. As we no longer flatten type-family applications, the logic is obsolete and can be removed. 2. We reported "out of scope" errors in a poly-kinded situation because `BoxedRep` and `Lifted` were considered out of scope. We fix this by using `pretendNameIsInScope`. fixes #20465
Diffstat (limited to 'compiler/GHC/Runtime')
-rw-r--r--compiler/GHC/Runtime/Eval.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs
index e28b2daeba..bceb9a4159 100644
--- a/compiler/GHC/Runtime/Eval.hs
+++ b/compiler/GHC/Runtime/Eval.hs
@@ -81,7 +81,6 @@ import GHC.Tc.Types.Constraint
import GHC.Tc.Types.Origin
import GHC.Builtin.Names ( toDynName, pretendNameIsInScope )
-import GHC.Builtin.Types ( isCTupleTyConName )
import GHC.Data.Maybe
import GHC.Data.FastString
@@ -873,8 +872,7 @@ getInfo allInfo name
ok n | n == name = True
-- The one we looked for in the first place!
| pretendNameIsInScope n = True
- | isBuiltInSyntax n = True
- | isCTupleTyConName n = True
+ -- See Note [pretendNameIsInScope] in GHC.Builtin.Names
| isExternalName n = isJust (lookupGRE_Name rdr_env n)
| otherwise = True