[commit: ghc] master: Improved panic message for zonkTcTyVarToTyVar (716acbb)

git at git.haskell.org git at git.haskell.org
Mon Dec 11 15:30:44 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/716acbb5084db6ace5f06bd6112aa1e24b46423a/ghc

>---------------------------------------------------------------

commit 716acbb5084db6ace5f06bd6112aa1e24b46423a
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Dec 8 17:32:16 2017 +0000

    Improved panic message for zonkTcTyVarToTyVar


>---------------------------------------------------------------

716acbb5084db6ace5f06bd6112aa1e24b46423a
 compiler/typecheck/TcMType.hs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs
index d7e6a5e..7473967 100644
--- a/compiler/typecheck/TcMType.hs
+++ b/compiler/typecheck/TcMType.hs
@@ -1532,10 +1532,14 @@ zonkTcTyVar tv
 
 -- Variant that assumes that any result of zonking is still a TyVar.
 -- Should be used only on skolems and SigTvs
-zonkTcTyVarToTyVar :: TcTyVar -> TcM TcTyVar
+zonkTcTyVarToTyVar :: HasDebugCallStack => TcTyVar -> TcM TcTyVar
 zonkTcTyVarToTyVar tv
   = do { ty <- zonkTcTyVar tv
-       ; return (tcGetTyVar "zonkTcTyVarToVar" ty) }
+       ; let tv' = case tcGetTyVar_maybe ty of
+                     Just tv' -> tv'
+                     Nothing  -> pprPanic "zonkTcTyVarToTyVar"
+                                          (ppr tv $$ ppr ty)
+       ; return tv' }
 
 {-
 %************************************************************************



More information about the ghc-commits mailing list