diff src/core_util.sml @ 2161:af3f5b58aed2

Add a missed case in CoreUtil.Exp fold
author Adam Chlipala <adam@chlipala.net>
date Sun, 05 Jul 2015 16:11:24 -0400
parents b90103106177
children
line wrap: on
line diff
--- a/src/core_util.sml	Sat Jul 04 19:24:26 2015 -0400
+++ b/src/core_util.sml	Sun Jul 05 16:11:24 2015 -0400
@@ -607,15 +607,19 @@
               | ERel _ => S.return2 eAll
               | ENamed _ => S.return2 eAll
               | ECon (dk, pc, cs, NONE) =>
-                S.map2 (ListUtil.mapfold (mfc ctx) cs,
-                        fn cs' =>
-                           (ECon (dk, pc, cs', NONE), loc))
-              | ECon (dk, n, cs, SOME e) =>
-                S.bind2 (mfe ctx e,
-                      fn e' =>
+                S.bind2 (mfpc ctx pc,
+                      fn pc' =>
                          S.map2 (ListUtil.mapfold (mfc ctx) cs,
-                                 fn cs' =>
-                                    (ECon (dk, n, cs', SOME e'), loc)))
+                              fn cs' =>
+                                 (ECon (dk, pc', cs', NONE), loc)))
+              | ECon (dk, pc, cs, SOME e) =>
+                S.bind2 (mfpc ctx pc,
+                      fn pc' =>
+                         S.bind2 (mfe ctx e,
+                               fn e' =>
+                                  S.map2 (ListUtil.mapfold (mfc ctx) cs,
+                                       fn cs' =>
+                                          (ECon (dk, pc', cs', SOME e'), loc))))
               | EFfi _ => S.return2 eAll
               | EFfiApp (m, x, es) =>
                 S.map2 (ListUtil.mapfold (mfet ctx) es,