Rules: Show the binder type in the unbound template binder error
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 26 Sep 2017 18:32:02 +0000 (14:32 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 26 Sep 2017 19:39:18 +0000 (15:39 -0400)
Reviewers: austin

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D4013

compiler/specialise/Rules.hs

index ec19740..edcab88 100644 (file)
@@ -583,7 +583,7 @@ matchN (in_scope, id_unf) rule_name tmpl_vars tmpl_es target_es
             = env
 
     unbound var = pprPanic "Template variable unbound in rewrite rule" $
-                  vcat [ text "Variable:" <+> ppr var
+                  vcat [ text "Variable:" <+> ppr var <+> dcolon <+> ppr (varType var)
                        , text "Rule" <+> pprRuleName rule_name
                        , text "Rule bndrs:" <+> ppr tmpl_vars
                        , text "LHS args:" <+> ppr tmpl_es