summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2023-01-26 16:16:32 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-27 23:54:55 -0500
commit638277ba7bd2683f539afb0bf469fe75376994e2 (patch)
treee5e0a9f4d8a7d0ea6c3a610e5ab105293ae91a5e /compiler/GHC/Tc
parent545bf8cf1844e2a1c18d2019d1f299ab10099873 (diff)
downloadhaskell-638277ba7bd2683f539afb0bf469fe75376994e2.tar.gz
Detect family instance orphans correctly
We were treating a type-family instance as a non-orphan if there was a type constructor on its /right-hand side/ that was local. Boo! Utterly wrong. With this patch, we correctly check the /left-hand side/ instead! Fixes #22717
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r--compiler/GHC/Tc/Errors/Ppr.hs3
-rw-r--r--compiler/GHC/Tc/Module.hs3
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs
index e173567844..ffe1d1c196 100644
--- a/compiler/GHC/Tc/Errors/Ppr.hs
+++ b/compiler/GHC/Tc/Errors/Ppr.hs
@@ -34,7 +34,7 @@ import GHC.Core.Class
import GHC.Core.DataCon
import GHC.Core.Coercion.Axiom (coAxiomTyCon, coAxiomSingleBranch)
import GHC.Core.ConLike
-import GHC.Core.FamInstEnv (famInstAxiom)
+import GHC.Core.FamInstEnv ( famInstAxiom )
import GHC.Core.InstEnv
import GHC.Core.TyCo.Rep (Type(..))
import GHC.Core.TyCo.Ppr (pprWithExplicitKindsWhen,
@@ -53,6 +53,7 @@ import {-# SOURCE #-} GHC.Tc.Types( getLclEnvLoc, lclEnvInGeneratedCode )
import GHC.Tc.Types.Origin
import GHC.Tc.Types.Rank (Rank(..))
import GHC.Tc.Utils.TcType
+
import GHC.Types.Error
import GHC.Types.FieldLabel (flIsOverloaded)
import GHC.Types.Hint (UntickedPromotedThing(..), pprUntickedConstructor, isBareSymbol)
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs
index 24a5d07090..edfa5a9258 100644
--- a/compiler/GHC/Tc/Module.hs
+++ b/compiler/GHC/Tc/Module.hs
@@ -112,7 +112,6 @@ import GHC.Hs.Dump
import GHC.Core.PatSyn ( pprPatSynType )
import GHC.Core.Predicate ( classMethodTy )
-import GHC.Core.FVs ( orphNamesOfFamInst )
import GHC.Core.InstEnv
import GHC.Core.TyCon
import GHC.Core.ConLike
@@ -124,7 +123,7 @@ import GHC.Core.Reduction ( Reduction(..) )
import GHC.Core.RoughMap( RoughMatchTc(..) )
import GHC.Core.TyCo.Ppr( debugPprType )
import GHC.Core.FamInstEnv
- ( FamInst, pprFamInst, famInstsRepTyCons
+ ( FamInst, pprFamInst, famInstsRepTyCons, orphNamesOfFamInst
, famInstEnvElts, extendFamInstEnvList, normaliseType )
import GHC.Parser.Header ( mkPrelImports )