about summary refs log tree commit diff stats
path: root/032array.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-06-17 11:30:24 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-06-17 11:30:24 -0700
commit1e76d01d4abc555e0468738516b8a0ea3ad34fdc (patch)
treeb437972b492091ced215ceab07f504c66db1b978 /032array.cc
parent94c598179d8f27e8ba69dd734bc2811ad779a1b7 (diff)
downloadmu-1e76d01d4abc555e0468738516b8a0ea3ad34fdc.tar.gz
3059
Diffstat (limited to '032array.cc')
-rw-r--r--032array.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/032array.cc b/032array.cc
index 8d08fdc2..6e583e6d 100644
--- a/032array.cc
+++ b/032array.cc
@@ -128,7 +128,7 @@ container foo [
 :(before "End Load Container Element Definition")
 {
   const type_tree* type = info.elements.back().type;
-  if (type->name == "array") {
+  if (type && type->name == "array") {
     if (!type->right) {
       raise << "container '" << name << "' doesn't specify type of array elements for '" << info.elements.back().name << "'\n" << end();
       continue;
@@ -140,6 +140,16 @@ container foo [
   }
 }
 
+:(scenario code_inside_container)
+container card [
+  rank:number <- next-ingredient
+]
+recipe foo [
+  1:card <- merge 3
+  2:number <- get 1:card rank:offset
+]
+# shouldn't die
+
 //:: To access elements of an array, use 'index'
 
 :(scenario index)