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 21:08:31 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-10 21:08:31 -0700
commit80411d01a3a31a8a08819b3d415811f746baab3a (patch)
tree79683fcfdf8f5a4fefc9858c005ef3a38e97b2ea /056static_dispatch.cc
parent5f141f6a461bfaf23cb75603b18c09d65a8d79af (diff)
downloadmu-80411d01a3a31a8a08819b3d415811f746baab3a.tar.gz
2830 - bring back deleted test from 2829
Issue 1 in 2829 is now fixed.
Diffstat (limited to '056static_dispatch.cc')
-rw-r--r--056static_dispatch.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/056static_dispatch.cc b/056static_dispatch.cc
index 8d1d27b7..1d57872d 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 "End Type Modifying Transforms")
+:(after "Transform.push_back(transform_names)")
 Transform.push_back(resolve_ambiguous_calls);  // idempotent
 
 //: In a later layer we'll introduce recursion in resolve_ambiguous_calls, by
@@ -545,5 +545,23 @@ 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;