about summary refs log tree commit diff stats
path: root/056static_dispatch.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-04-10 20:47:44 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-10 20:55:10 -0700
commit5f141f6a461bfaf23cb75603b18c09d65a8d79af (patch)
treee246faa3c58ef1a4db34b8739ad1bb249b62f230 /056static_dispatch.cc
parent5939c226b41d6876aa7a36833a01a241925ddd00 (diff)
downloadmu-5f141f6a461bfaf23cb75603b18c09d65a8d79af.tar.gz
2829 - issues while switching to 'put'
1. It turns out we couldn't overload 'get' and 'get-address' until now,
because transform_names looks for those names, and the
resolve_ambiguous_calls transform happens before transform_names. Why
does resolve_ambiguous_calls happen before transform_names? Because if
my students made mistakes in the ingredients to an instruction they got
overzealous errors from resolve_ambiguous_calls. Now this impacts 'put'
as well, which is already overloaded for tables. Not sure what to do
about this; I'm going to go back to the overzealous errors, and just
teach students to visually scan past them for now.

2. I need addresses in a third place besides storing to containers and
arrays, and managing the heap -- to synchronize routines.
wait-for-location requires an address. Not sure what to do about this..
Diffstat (limited to '056static_dispatch.cc')
-rw-r--r--056static_dispatch.cc20
1 files changed, 1 insertions, 19 deletions
diff --git a/056static_dispatch.cc b/056static_dispatch.cc
index 1d57872d..8d1d27b7 100644
--- a/056static_dispatch.cc
+++ b/056static_dispatch.cc
@@ -134,7 +134,7 @@ for (int i = 0; i < SIZE(caller.products); ++i)
   check_or_set_invalid_types(caller.products.at(i).type, maybe(caller.name), "recipe header product");
 
 //: after filling in all missing types (because we'll be introducing 'blank' types in this transform in a later layer, for shape-shifting recipes)
-:(after "Transform.push_back(transform_names)")
+:(after "End Type Modifying Transforms")
 Transform.push_back(resolve_ambiguous_calls);  // idempotent
 
 //: In a later layer we'll introduce recursion in resolve_ambiguous_calls, by
@@ -545,23 +545,5 @@ def! foo x:address:number -> y:number [
 +mem: storing 34 in location 2
 $error: 0
 
-:(scenario dispatch_errors_come_after_unknown_name_errors)
-% Hide_errors = true;
-def main [
-  y:number <- foo x
-]
-def foo a:number -> b:number [
-  local-scope
-  load-ingredients
-  return 34
-]
-def foo a:boolean -> b:number [
-  local-scope
-  load-ingredients
-  return 35
-]
-+error: main: missing type for x in 'y:number <- foo x'
-+error: main: failed to find a matching call for 'y:number <- foo x'
-
 :(before "End Includes")
 using std::abs;