From 5108e84abb102920ab28e3aeb083ab6e483eb2f6 Mon Sep 17 00:00:00 2001
From: John Ericson <John.Ericson@Obsidian.Systems>
Date: Wed, 6 May 2020 19:49:04 -0400
Subject: [PATCH] More judiciously panic in `ts_pat`

---
 compiler/GHC/Tc/Gen/Pat.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/GHC/Tc/Gen/Pat.hs b/compiler/GHC/Tc/Gen/Pat.hs
index 59a9ca1e23b..234fbcb0488 100644
--- a/compiler/GHC/Tc/Gen/Pat.hs
+++ b/compiler/GHC/Tc/Gen/Pat.hs
@@ -647,11 +647,11 @@ AST is used for the subtraction operation.
 -- Here we get rid of it and add the finalizers to the global environment.
 --
 -- See Note [Delaying modFinalizers in untyped splices] in GHC.Rename.Splice.
-  SplicePat _ (HsSpliced _ mod_finalizers (HsSplicedPat pat)) -> do
+  SplicePat _ splice -> case splice of
+    (HsSpliced _ mod_finalizers (HsSplicedPat pat)) -> do
        addModFinalizersWithLclEnv mod_finalizers
        tc_pat pat_ty pat penv thing_inside
-
-  _other_pat -> panic "tc_pat"
+    _ -> panic "invalid splice in splice pat"
 
 
 {-
-- 
GitLab