The attached patch should generate the desired error message. If someone wants a test for this, just let me know which test file the test belongs in and I will be happy to post an appropriate test for that file.
--- a/src/classes/Positional.pir +++ b/src/classes/Positional.pir @@ -105,9 +105,24 @@ Returns a list element or slice. .param pmc invocant .param pmc argsblock .param pmc options :slurpy :named + + # if elements fails we can probably count on postcfix to err adequately + push_eh call_and_throw_err $I0 = elements invocant $P0 = box $I0 set_hll_global ['Whatever'], '$!slice', $P0 + goto just_call + +call_and_throw_err: + .const string NO_ELEMENTS_MARKER = "elements() not implemented" + .get_results ($P0) + $I0 = length NO_ELEMENTS_MARKER + $S0 = $P0 + $S0 = substr $S0, 0, $I0 + if $S0 == NO_ELEMENTS_MARKER goto just_call + rethrow $P0 + +just_call: .local pmc args args = argsblock() args = 'list'(args)