diff options
-rw-r--r-- | 030container.cc | 11 | ||||
-rw-r--r-- | 032array.cc | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/030container.cc b/030container.cc index 3684a5ce..25303f39 100644 --- a/030container.cc +++ b/030container.cc @@ -156,6 +156,7 @@ case GET: { raise_error << maybe(get(Recipe, r).name) << "invalid offset " << offset_value << " for " << get(Type, base_type).name << '\n' << end(); break; } + if (inst.products.empty()) break; reagent product = inst.products.at(0); // Update GET product in Check const reagent element = element_type(base, offset_value); @@ -242,6 +243,16 @@ recipe main [ ] +error: main: 'get' 1:offset (1) on point-number can't be saved in 15:address:number; type should be number but is <address : <number : <>>> +//: we might want to call 'get' without saving the results, say in a sandbox + +:(scenario get_without_product) +recipe main [ + 12:number <- copy 34 + 13:number <- copy 35 + get 12:point/raw, 1:offset # unsafe +] +# just don't die + //:: To write to elements of containers, you need their address. :(scenario get_address) diff --git a/032array.cc b/032array.cc index 085e2b52..2bdafbbf 100644 --- a/032array.cc +++ b/032array.cc @@ -254,6 +254,18 @@ recipe main [ ] +error: main: 'index' on *8:address:array:point can't be saved in 9:number; type should be point +//: we might want to call 'index' without saving the results, say in a sandbox + +:(scenario index_without_product) +recipe main [ + 1:array:number:3 <- create-array + 2:number <- copy 14 + 3:number <- copy 15 + 4:number <- copy 16 + index 1:array:number:3, 0 +] +# just don't die + //:: To write to elements of containers, you need their address. :(scenario index_address) |