diff options
-rw-r--r-- | 042name.cc | 2 | ||||
-rw-r--r-- | 057static_dispatch.cc | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/042name.cc b/042name.cc index 949f0dde..e2c11abb 100644 --- a/042name.cc +++ b/042name.cc @@ -18,7 +18,7 @@ recipe main [ +error: main: use before set: y # todo: detect conditional defines -:(before "End Instruction Modifying Transforms") +:(after "End Type Modifying Transforms") Transform.push_back(transform_names); // idempotent :(before "End Globals") diff --git a/057static_dispatch.cc b/057static_dispatch.cc index 222bd97f..b57ff4c9 100644 --- a/057static_dispatch.cc +++ b/057static_dispatch.cc @@ -143,7 +143,7 @@ for (long long int i = 0; i < SIZE(caller.products); ++i) { } //: 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 :(code) @@ -492,3 +492,21 @@ recipe! foo x:address:number -> y:number [ +mem: storing 34 in location 2 $error: 0 $warn: 0 + +:(scenario dispatch_errors_come_after_unknown_name_errors) +% Hide_errors = true; +recipe main [ + y:number <- foo x +] +recipe foo a:number -> b:number [ + local-scope + load-ingredients + reply 34 +] +recipe foo a:boolean -> b:number [ + local-scope + load-ingredients + reply 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' |