diff src/core_util.sml @ 796:6271f0e3c272

Fix a nasty binding bug in CoreUtil
author Adam Chlipala <adamc@hcoop.net>
date Thu, 14 May 2009 09:11:58 -0400
parents 8688e01ae469
children ef6de4075dc1
line wrap: on
line diff
--- a/src/core_util.sml	Thu May 14 08:15:36 2009 -0400
+++ b/src/core_util.sml	Thu May 14 09:11:58 2009 -0400
@@ -772,7 +772,13 @@
               | PConFfi {mod = m, datatyp, params, con, arg, kind} =>
                 S.map2 ((case arg of
                              NONE => S.return2 NONE
-                           | SOME c => S.map2 (mfc ctx c, SOME)),
+                           | SOME c =>
+                             let
+                                 val k = (KType, ErrorMsg.dummySpan)
+                                 val ctx' = foldl (fn (x, ctx) => bind (ctx, RelC (x, k))) ctx params
+                             in
+                                 S.map2 (mfc ctx' c, SOME)
+                             end),
                         fn arg' =>
                            PConFfi {mod = m, datatyp = datatyp, params = params,
                                     con = con, arg = arg', kind = kind})