From 2e4f0bbd12231a51ae08df4fe0f8847111fde405 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 23 Oct 2016 23:15:12 -0700 Subject: 3578 --- html/071recipe.cc.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'html/071recipe.cc.html') diff --git a/html/071recipe.cc.html b/html/071recipe.cc.html index 2a63b5e8..7db245d8 100644 --- a/html/071recipe.cc.html +++ b/html/071recipe.cc.html @@ -375,7 +375,7 @@ $error: 0 } ] # error should be as if foo is not a recipe -+error: main: missing type for foo in 'break-if foo' ++error: main: missing type for 'foo' in 'break-if foo' :(before "End JUMP_IF Checks") check_for_recipe_literals(inst, get(Recipe, r)); @@ -384,10 +384,22 @@ check_for_recipe_literals(inst:(code) void check_for_recipe_literals(const instruction& inst, const recipe& caller) { for (int i = 0; i < SIZE(inst.ingredients); ++i) { - if (is_mu_recipe(inst.ingredients.at(i))) - raise << maybe(caller.name) << "missing type for " << inst.ingredients.at(i).original_string << " in '" << inst.original_string << "'\n" << end(); + if (is_mu_recipe(inst.ingredients.at(i))) { + raise << maybe(caller.name) << "missing type for '" << inst.ingredients.at(i).original_string << "' in '" << inst.original_string << "'\n" << end(); + if (is_present_in_ingredients(caller, inst.ingredients.at(i).name)) + raise << " did you forget 'load-ingredients'?\n" << end(); + } } } + +:(scenario load_ingredients_missing_error_3) +% Hide_errors = true; +def foo {f: (recipe num -> num)} [ + local-scope + b:num <- call f, 1 +] ++error: foo: missing type for 'f' in 'b:num <- call f, 1' ++error: did you forget 'load-ingredients'? -- cgit 1.4.1-2-gfad0