Fixed chained functions, resolved #52

This commit is contained in:
2023-06-14 17:41:30 +10:00
parent f25f389b4e
commit 1481216e69
3 changed files with 32 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
{
fn a() {
fn b() {
return 42;
}
return b;
}
assert a()() == 42, "function within function failed";
}
{
fn a() {
fn b() {
fn c() {
return 42;
}
return c;
}
return b;
}
assert a()()() == 42, "function within function within function failed";
}
print "All good";