about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--021check_instruction.cc6
-rw-r--r--html/021check_instruction.cc.html6
2 files changed, 6 insertions, 6 deletions
diff --git a/021check_instruction.cc b/021check_instruction.cc
index 8b34b55f..90f24926 100644
--- a/021check_instruction.cc
+++ b/021check_instruction.cc
@@ -25,7 +25,7 @@ void check_instruction(const recipe_ordinal r) {
           raise << maybe(get(Recipe, r).name) << "too many products in '" << inst.original_string << "'\n" << end();
           break;
         }
-        for (int i = 0;  i < SIZE(inst.ingredients);  ++i) {
+        for (int i = 0;  i < SIZE(inst.products);  ++i) {
           if (!types_coercible(inst.products.at(i), inst.ingredients.at(i))) {
             raise << maybe(get(Recipe, r).name) << "can't copy '" << inst.ingredients.at(i).original_string << "' to '" << inst.products.at(i).original_string << "'; types don't match\n" << end();
             goto finish_checking_instruction;
@@ -46,9 +46,9 @@ void check_instruction(const recipe_ordinal r) {
 :(scenario copy_checks_reagent_count)
 % Hide_errors = true;
 def main [
-  1:num <- copy 34, 35
+  1:num, 2:num <- copy 34
 ]
-+error: main: ingredients and products should match in '1:num <- copy 34, 35'
++error: main: too many products in '1:num, 2:num <- copy 34'
 
 :(scenario write_scalar_to_array_disallowed)
 % Hide_errors = true;
diff --git a/html/021check_instruction.cc.html b/html/021check_instruction.cc.html
index 4bf85679..6b348e01 100644
--- a/html/021check_instruction.cc.html
+++ b/html/021check_instruction.cc.html
@@ -88,7 +88,7 @@ if ('onhashchange' in window) {
 <span id="L25" class="LineNr"> 25 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;too many products in '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
 <span id="L26" class="LineNr"> 26 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
 <span id="L27" class="LineNr"> 27 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Delimiter">}</span>
-<span id="L28" class="LineNr"> 28 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span>  i &lt; <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L28" class="LineNr"> 28 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span>  i &lt; <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
 <span id="L29" class="LineNr"> 29 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!types_coercible<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">),</span> inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Delimiter">{</span>
 <span id="L30" class="LineNr"> 30 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> &lt;&lt; <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;can't copy '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>original_string &lt;&lt; <span class="Constant">&quot;' to '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>original_string &lt;&lt; <span class="Constant">&quot;'; types don't match</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span>
 <span id="L31" class="LineNr"> 31 </span>  <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">goto</span> finish_checking_instruction<span class="Delimiter">;</span>
@@ -109,9 +109,9 @@ if ('onhashchange' in window) {
 <span id="L46" class="LineNr"> 46 </span><span class="Delimiter">:(scenario copy_checks_reagent_count)</span>
 <span id="L47" class="LineNr"> 47 </span><span class="Special">% Hide_errors = true;</span>
 <span id="L48" class="LineNr"> 48 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [
-<span id="L49" class="LineNr"> 49 </span>  <span class="Constant">1</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">34</span><span class="Delimiter">,</span> <span class="Constant">35</span>
+<span id="L49" class="LineNr"> 49 </span>  <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">2</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>
 <span id="L50" class="LineNr"> 50 </span>]
-<span id="L51" class="LineNr"> 51 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: ingredients and products should match in '1:num &lt;- copy 34, 35'</span>
+<span id="L51" class="LineNr"> 51 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: too many products in '1:num, 2:num &lt;- copy 34'</span>
 <span id="L52" class="LineNr"> 52 </span>
 <span id="L53" class="LineNr"> 53 </span><span class="Delimiter">:(scenario write_scalar_to_array_disallowed)</span>
 <span id="L54" class="LineNr"> 54 </span><span class="Special">% Hide_errors = true;</span>