summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2019-10-13 14:50:16 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2019-10-13 14:50:16 -0400
commit404429ca9197a508efc1be5425d6fc4a00a5eae9 (patch)
tree88cfeb8b5334e0cb9bf9a7b991eeb741dfc9e9ee
parentb71c7b9ec4580326772a212fbe011322ae1ac063 (diff)
Undo a questionable optimization, almost 10 years later (closes #179)
-rw-r--r--src/mono_reduce.sml3
-rw-r--r--tests/tooEager.ur18
2 files changed, 19 insertions, 2 deletions
diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml
index 5bcb6f57..c3c9da98 100644
--- a/src/mono_reduce.sml
+++ b/src/mono_reduce.sml
@@ -597,8 +597,7 @@ fun reduce' (file : file) =
((*Print.prefaces "trySub"
[("e", MonoPrint.p_exp env (e, ErrorMsg.dummySpan))];*)
case t of
- (TFfi ("Basis", "string"), _) => doSub ()
- | (TSignal _, _) => e
+ (TSignal _, _) => e
| _ =>
case e' of
(ECase _, _) => e
diff --git a/tests/tooEager.ur b/tests/tooEager.ur
new file mode 100644
index 00000000..c84a6d6c
--- /dev/null
+++ b/tests/tooEager.ur
@@ -0,0 +1,18 @@
+fun test (i: list int) : transaction unit =
+ a <- return (Some "abc");
+ c <- (case a of
+ None => return "1"
+ | Some b =>
+ debug "not happening :(";
+ return "2"
+ );
+ (case i of
+ [] => return ()
+ | first :: _ => debug c)
+
+fun main (): transaction page =
+ return <xml>
+ <body>
+ <button onclick={fn _ => rpc (test [])}>click</button>
+ </body>
+ </xml>