summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-08-19 16:48:49 +0200
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-08-19 16:48:49 +0200
commitdf1d808f26544cbb77d85773d672137c65fd3cc7 (patch)
treee669ce4fa8cd0c458ccbd774471772c1ad390daa
parent4ff4d434e9a90623afce00b43e2a5a1ccbdb4c05 (diff)
downloadhaskell-wip/T20200-restore.tar.gz
Convert lookupIdSubst panic back to a warning (#20200)wip/T20200-restore
-rw-r--r--compiler/GHC/Core/Subst.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs
index ddb8e71f1f..1544e5b192 100644
--- a/compiler/GHC/Core/Subst.hs
+++ b/compiler/GHC/Core/Subst.hs
@@ -61,6 +61,7 @@ import GHC.Types.Unique.Supply
import GHC.Builtin.Names
import GHC.Data.Maybe
+import GHC.Utils.Trace
import GHC.Utils.Misc
import GHC.Utils.Outputable
import GHC.Utils.Panic
@@ -255,9 +256,10 @@ lookupIdSubst (Subst in_scope ids _ _) 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)
+ -- See #20200
+ | otherwise = warnPprTrace 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