changeset 495:98f85c1bc867

Fix type calculation for applying-a-case optimization
author Adam Chlipala <adamc@hcoop.net>
date Tue, 11 Nov 2008 20:24:55 -0500
parents 1bbcc3345d12
children 423a054646ec
files src/mono_opt.sml
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/mono_opt.sml	Tue Nov 11 19:58:25 2008 -0500
+++ b/src/mono_opt.sml	Tue Nov 11 20:24:55 2008 -0500
@@ -292,7 +292,7 @@
                        {disc = disc,
                         result = (TRecord [], loc)}), loc)
 
-      | EApp ((ECase (discE, pes, {disc, ...}), loc), arg as (ERecord [], _)) =>
+      | EApp ((ECase (discE, pes, {disc, result = (TFun (_, ran), _)}), loc), arg as (ERecord [], _)) =>
         let
             fun doBody e =
                 case #1 e of
@@ -302,7 +302,7 @@
             optExp (ECase (discE,
                            map (fn (p, e) => (p, doBody e)) pes,
                            {disc = disc,
-                            result = (TRecord [], loc)}), loc)
+                            result = ran}), loc)
         end
 
       | EWrite (EQuery {exps, tables, state, query,