mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Fixed indexing in argument lists, resolved #102
This commit is contained in:
20
test/scripts/indexing-in-argument-list-bugfix.toy
Normal file
20
test/scripts/indexing-in-argument-list-bugfix.toy
Normal 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";
|
||||
Reference in New Issue
Block a user