diff src/mono_reduce.sml @ 848:e8594cfa3236

Fix MonoReduce unsoundness with lets and fns
author Adam Chlipala <adamc@hcoop.net>
date Sat, 13 Jun 2009 15:42:24 -0400
parents 20fe00fd81da
children 7a4b026e45dd
line wrap: on
line diff
--- a/src/mono_reduce.sml	Sat Jun 13 14:29:36 2009 -0400
+++ b/src/mono_reduce.sml	Sat Jun 13 15:42:24 2009 -0400
@@ -461,11 +461,10 @@
                                                  (EApp (b, liftExpInExp 0 e'), loc)), loc))
 
                       | ELet (x, t, e', (EAbs (x', t' as (TRecord [], _), ran, e''), loc)) =>
-                        (*if impure e' then
-                              e
-                          else*)
-                        (* Seems unsound in general without the check... should revisit later *)
-                        EAbs (x', t', ran, (ELet (x, t, liftExpInExp 0 e', swapExpVars 0 e''), loc))
+                        if impure e' then
+                            e
+                        else
+                            EAbs (x', t', ran, (ELet (x, t, liftExpInExp 0 e', swapExpVars 0 e''), loc))
 
                       | ELet (x, t, e', b) =>
                         let