From c1585c88fa61918a9c464f7d6eb5b1b4b107048b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 10 Nov 2015 19:19:53 -0800 Subject: 2417 - support mutable ingredients in headers If a name repeats between ingredients, we raise an error. If a name repeats across ingredients and products, every call should share the same name across the corresponding ingredients and products. --- 036call_reply.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '036call_reply.cc') diff --git a/036call_reply.cc b/036call_reply.cc index 68bc533c..97853a2b 100644 --- a/036call_reply.cc +++ b/036call_reply.cc @@ -67,7 +67,7 @@ case REPLY: { if (ingredient_index >= SIZE(caller_instruction.ingredients)) raise_error << maybe(current_recipe_name()) << "'same-as-ingredient' metadata overflows ingredients in: " << caller_instruction.to_string() << '\n' << end(); if (!is_dummy(caller_instruction.products.at(i)) && caller_instruction.products.at(i).value != caller_instruction.ingredients.at(ingredient_index).value) - raise_error << maybe(current_recipe_name()) << "'same-as-ingredient' product from call to " << callee << " must be " << caller_instruction.ingredients.at(ingredient_index).original_string << " rather than " << caller_instruction.products.at(i).original_string << '\n' << end(); + raise_error << maybe(current_recipe_name()) << "'" << caller_instruction.to_string() << "' should write to " << caller_instruction.ingredients.at(ingredient_index).original_string << " rather than " << caller_instruction.products.at(i).original_string << '\n' << end(); } } // End Reply @@ -117,7 +117,7 @@ recipe test1 [ 10:number <- next-ingredient reply 10:number/same-as-ingredient:0 ] -+error: main: 'same-as-ingredient' product from call to test1 must be 1:number rather than 2:number ++error: main: '2:number <- test1 1:number' should write to 1:number rather than 2:number :(scenario reply_same_as_ingredient_dummy) # % Hide_errors = true; -- cgit 1.4.1-2-gfad0