Reverse string slice cannot handle final character
Submitted by Rikard Nordgren
Assigned to Michael 'Mickey' Lauer
Link to original bug (#644245)
Description
This short program compiles but gives a runtime error:
public static int main (string[] args)
{
string s = "Testing";
string slice = s[-3:0];
stdout.printf(slice + "\n");
return 0;
}
Error:
** (process:5817): CRITICAL **: string_slice: assertion `start <= end' failed
I expected this program to output "ing".
See also
Edited by Rico Tzschichholz