Fixed indexing in argument lists, resolved #102

This commit is contained in:
2023-08-09 02:25:07 +10:00
parent 401de578a5
commit 62fe86f99b
4 changed files with 32 additions and 12 deletions

View File

@@ -0,0 +1,20 @@
fn max(lhs, rhs) {
if (lhs > rhs) {
return lhs;
}
else {
return rhs;
}
}
var array = [42];
var result = null;
//problematic line
result = max(0, array[0]);
assert result == 42, "Indexing in argument list failed";
print "All good";

View File

@@ -129,6 +129,7 @@ int main() {
"index-assignment-left-bugfix.toy",
"index-dictionaries.toy",
"index-strings.toy",
"indexing-in-argument-list-bugfix.toy",
"jumps.toy",
"jumps-in-functions.toy",
"logicals.toy",