about summary refs log tree commit diff stats
path: root/036call_reply.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-02-15 13:52:51 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-02-15 14:07:23 -0800
commit4637d58f6c4777f9643f73de859af23c38acca2c (patch)
treeaed44d16e0ae6a7961351d964189e3cbca4d8706 /036call_reply.cc
parentf592d8629f3fddaebff4abece8f92e57e9379418 (diff)
downloadmu-4637d58f6c4777f9643f73de859af23c38acca2c.tar.gz
2661 - warn if a reply doesn't match recipe header
Thanks Nicolas Léveillé for running up against this bug:
  https://news.ycombinator.com/item?id=11094837

(Also noticed and fixed several subsidiary issues. This whole aspect
doesn't seem fully baked yet.)
Diffstat (limited to '036call_reply.cc')
-rw-r--r--036call_reply.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/036call_reply.cc b/036call_reply.cc
index d24eb98a..eb4c1aba 100644
--- a/036call_reply.cc
+++ b/036call_reply.cc
@@ -105,8 +105,9 @@ void check_types_of_reply_instructions(recipe_ordinal r) {
             raise_error << maybe(caller.name) << "too few ingredients in '" << caller_instruction.to_string() << "'\n" << end();
             goto finish_reply_check;
           }
-          if (!is_dummy(caller_instruction.products.at(i)) && caller_instruction.products.at(i).name != caller_instruction.ingredients.at(ingredient_index).name)
+          if (!is_dummy(caller_instruction.products.at(i)) && !is_literal(caller_instruction.ingredients.at(ingredient_index)) && caller_instruction.products.at(i).name != caller_instruction.ingredients.at(ingredient_index).name) {
             raise_error << maybe(caller.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();
+          }
         }
       }
       finish_reply_check:;