From 90f7fcefd32e275077fb8bf5ffd44f3163553343 Mon Sep 17 00:00:00 2001 From: Bretton Date: Tue, 29 Aug 2023 17:04:05 -0700 Subject: [PATCH 1/2] Do apSubst on Type field of EPropGuards for TVars --- src/Cryptol/TypeCheck/Subst.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Cryptol/TypeCheck/Subst.hs b/src/Cryptol/TypeCheck/Subst.hs index a45eeeedb..c485a71b6 100644 --- a/src/Cryptol/TypeCheck/Subst.hs +++ b/src/Cryptol/TypeCheck/Subst.hs @@ -435,7 +435,9 @@ instance TVars Expr where EWhere e ds -> EWhere !$ (go e) !$ (apSubst su ds) - EPropGuards guards ty -> EPropGuards !$ (\(props, e) -> (apSubst su `fmap'` props, apSubst su e)) `fmap'` guards .$ ty + EPropGuards guards ty -> EPropGuards + !$ (\(props, e) -> (apSubst su `fmap'` props, apSubst su e)) `fmap'` guards + !$ apSubst su ty instance TVars Match where apSubst su (From x len t e) = From x !$ (apSubst su len) !$ (apSubst su t) !$ (apSubst su e) From 2e8ec75d521edae0f78701a0b4c8d981a7e9facf Mon Sep 17 00:00:00 2001 From: Bretton Date: Thu, 31 Aug 2023 15:10:17 -0700 Subject: [PATCH 2/2] Use go instead of apSubst in instance TVars Expr --- src/Cryptol/TypeCheck/Subst.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cryptol/TypeCheck/Subst.hs b/src/Cryptol/TypeCheck/Subst.hs index c485a71b6..c8343ea44 100644 --- a/src/Cryptol/TypeCheck/Subst.hs +++ b/src/Cryptol/TypeCheck/Subst.hs @@ -436,7 +436,7 @@ instance TVars Expr where EWhere e ds -> EWhere !$ (go e) !$ (apSubst su ds) EPropGuards guards ty -> EPropGuards - !$ (\(props, e) -> (apSubst su `fmap'` props, apSubst su e)) `fmap'` guards + !$ (\(props, e) -> (apSubst su `fmap'` props, go e)) `fmap'` guards !$ apSubst su ty instance TVars Match where