diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-03-03 09:43:27 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-03-03 10:28:51 +0000 |
commit | 11acd72ddb32d60706d038b8daae4ca5602c5397 (patch) | |
tree | f2d19aca7129bd9714af65eb506b48a2f5de3c5c | |
parent | 29095185777f5ef42d9f09bbd377dcf029d2147f (diff) | |
download | haskell-wip/9.2-lookupIdSubst.tar.gz |
Change lookupIdSubst panic back to a warningwip/9.2-lookupIdSubst
We don't want to backport the number of commits which were necessary to
fix this issue for the 9.2.2 release so for now just turn it back into a
warning.
Partially reverts 0e5236add8dc83ec5f66a5e7bcb7f31d6636fcf0
-rw-r--r-- | compiler/GHC/Core/Subst.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs index d062227a9b..1c7d138574 100644 --- a/compiler/GHC/Core/Subst.hs +++ b/compiler/GHC/Core/Subst.hs @@ -66,6 +66,7 @@ import GHC.Utils.Misc import GHC.Utils.Outputable import GHC.Utils.Panic import Data.List (mapAccumL) +import GHC.Driver.Ppr @@ -253,10 +254,10 @@ lookupIdSubst (Subst in_scope ids _ _) v | not (isLocalId v) = Var v | Just e <- lookupVarEnv ids v = e | Just v' <- lookupInScope in_scope v = Var v' - -- Vital! See Note [Extending the Subst] - -- If v isn't in the InScopeSet, we panic, because - -- it's a bad bug and we reallly want to know - | otherwise = pprPanic "lookupIdSubst" (ppr v $$ ppr in_scope) + + | otherwise = WARN( True, text "GHC.Core.Subst.lookupIdSubst" <+> ppr v + $$ ppr in_scope) + Var v -- | Find the substitution for a 'TyVar' in the 'Subst' lookupTCvSubst :: Subst -> TyVar -> Type |