# HG changeset patch # User Adam Chlipala # Date 1226453095 18000 # Node ID 98f85c1bc867ddf096d62c707ca30c3efd88f7c0 # Parent 1bbcc3345d127815c24054dd51ca4fa6b3a9f0d7 Fix type calculation for applying-a-case optimization diff -r 1bbcc3345d12 -r 98f85c1bc867 src/mono_opt.sml --- 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,