Simon Peyton Jones pushed to branch wip/T26115 at Glasgow Haskell Compiler / GHC Commits: d724cbc6 by Simon Peyton Jones at 2025-07-21T17:44:22+01:00 Wibble origin of Deriv - - - - - 1 changed file: - compiler/GHC/Tc/Deriv/Utils.hs Changes: ===================================== compiler/GHC/Tc/Deriv/Utils.hs ===================================== @@ -55,16 +55,18 @@ import GHC.Unit.Module (getModule) import GHC.Unit.Module.Warnings import GHC.Unit.Module.ModIface (mi_fix) -import GHC.Types.Fixity.Env (lookupFixity) import GHC.Iface.Load (loadInterfaceForName) + +import GHC.Types.Fixity.Env (lookupFixity) import GHC.Types.Name import GHC.Types.SrcLoc -import GHC.Utils.Misc import GHC.Types.Var.Set +import GHC.Types.Id( idName ) import GHC.Builtin.Names import GHC.Builtin.Names.TH (liftClassKey) +import GHC.Utils.Misc import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Utils.Error @@ -714,7 +716,13 @@ emitPredSpecConstraints _ (SimplePredSpec { sps_pred = wanted_pred -- but here when we are trying to infer the context for an instance decl, we -- need that half-solved implication. See deriving/should_compile/T20815 -- and Note [Inferred contexts from method constraints] - = do { let skol_info_anon = DerivSkol wanted_pred + = do { let skol_info_anon + = case orig of + DerivOriginCoerce meth _ _ _ -> MethSkol (idName meth) False + _ -> pprPanic "emitPredSpecConstraints" (ppr orig $$ ppr wanted_pred) + -- We only get a polymorphic wanted_pred from DerivOriginCoerce + -- This is a bit messy, but arises from the fact that SimplePredSpe + -- is not really simple! ; skol_info <- mkSkolemInfo skol_info_anon ; (_wrapper, tv_prs, givens, wanted_rho) <- topSkolemise skol_info wanted_pred -- _wrapper: we ignore the evidence from all these constraints View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d724cbc65c0d1da25402f80cc3208845... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d724cbc65c0d1da25402f80cc3208845... You're receiving this email because of your account on gitlab.haskell.org.