about summary refs log tree commit diff stats
path: root/072scheduler.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-22 04:44:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-22 04:44:07 -0700
commita542b5a9c58993c95332bc7f3f5289dac2d7a945 (patch)
tree8662f3f7241f49b36df874d10021a3a9980514d2 /072scheduler.cc
parent70f4e9b60d4726d8c42560ec5cf209eb3a33f826 (diff)
downloadmu-a542b5a9c58993c95332bc7f3f5289dac2d7a945.tar.gz
3545
Type-check ingredients of 'start-running'
Diffstat (limited to '072scheduler.cc')
-rw-r--r--072scheduler.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/072scheduler.cc b/072scheduler.cc
index e027b9dc..c5cd616a 100644
--- a/072scheduler.cc
+++ b/072scheduler.cc
@@ -239,6 +239,21 @@ def f2 [
 ]
 +mem: storing 4 in location 2
 
+//: type-checking for 'start-running'
+
+:(scenario start_running_checks_types)
+% Hide_errors = true;
+def f1 [
+  start-running f2, 3
+]
+def f2 n:&:num [
+]
++error: f1: ingredient 0 has the wrong type at 'start-running f2, 3'
+
+// 'start-running' only uses the ingredients of the callee, not its products
+:(before "End is_indirect_call_with_ingredients Special-cases")
+if (r == START_RUNNING) return true;
+
 //: more complex: refcounting management when starting up new routines
 
 :(scenario start_running_immediately_updates_refcounts_of_ingredients)