about summary refs log tree commit diff stats
path: root/html/032array.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-11-05 21:38:11 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-11-05 21:38:11 -0700
commit0aa6813b004c8003ff675f52850595bbcc2a66a9 (patch)
tree758d2097e65774aaaf8d55885d791d1d25fbf795 /html/032array.cc.html
parentcb48c5d79ca41d4b8d6f44f54cca53bfcb7b8670 (diff)
downloadmu-0aa6813b004c8003ff675f52850595bbcc2a66a9.tar.gz
3626
Diffstat (limited to 'html/032array.cc.html')
-rw-r--r--html/032array.cc.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/html/032array.cc.html b/html/032array.cc.html
index 2a3d7b1b..d8264b08 100644
--- a/html/032array.cc.html
+++ b/html/032array.cc.html
@@ -342,6 +342,17 @@ type_tree* copy_array_element<span class="Delimiter">(</span><span class="Normal
   CHECK_EQ<span class="Delimiter">(</span>array_length<span class="Delimiter">(</span>x<span class="Delimiter">),</span> <span class="Constant">3</span><span class="Delimiter">);</span>
 <span class="Delimiter">}</span>
 
+<span class="Delimiter">:(scenario index_truncates)</span>
+<span class="muRecipe">def</span> main [
+  <span class="Constant">1</span>:array:num:<span class="Constant">3</span><span class="Special"> &lt;- </span>create-array
+  <span class="Constant">2</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>
+  <span class="Constant">3</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>
+  <span class="Constant">4</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>
+  <span class="Constant">5</span>:num<span class="Special"> &lt;- </span>index <span class="Constant">1</span>:array:num:<span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">1.5</span>  <span class="Comment"># non-whole number</span>
+]
+<span class="Comment"># fraction is truncated away</span>
+<span class="traceContains">+mem: storing 15 in location 5</span>
+
 <span class="Delimiter">:(scenario index_out_of_bounds)</span>
 <span class="Special">% Hide_errors = true;</span>
 <span class="muRecipe">def</span> main [