changeset 1947:619191c71abb

Compile-time error for periodic tasks in nonpersistent protocols
author Adam Chlipala <adam@chlipala.net>
date Sun, 29 Dec 2013 13:18:50 -0500
parents f1485ed65d6c
children 6b80900ddc66
files src/monoize.sml
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/monoize.sml	Sun Dec 29 10:29:26 2013 -0500
+++ b/src/monoize.sml	Sun Dec 29 13:18:50 2013 -0500
@@ -4442,7 +4442,13 @@
 
                 val un = (L'.TRecord [], loc)
                 val t = if MonoUtil.Exp.exists {typ = fn _ => false,
-                                                exp = fn L'.EFfiApp ("Basis", "periodic", _) => true
+                                                exp = fn L'.EFfiApp ("Basis", "periodic", _) =>
+                                                         (if #persistent (Settings.currentProtocol ()) then
+                                                              ()
+                                                          else
+                                                              E.errorAt (#2 e1)
+                                                                        ("Periodic tasks aren't allowed in the selected protocol (" ^ #name (Settings.currentProtocol ()) ^ ").");
+                                                          true)
                                                        | _ => false} e1 then
                             (L'.TFfi ("Basis", "int"), loc)
                         else