Bug - Fixed ASH return within a "finally" clause does not actually return

Veracity

Developer
Staff member
Code:
int test( int input )
{
    try {
        print("You gave me " + input);
    } finally {
        if (input == 100) {
            int output = input + 1;
            print("I prefer " + output);
            return output;
        }
    }
    print("Good enough!");
    return input;
}

print("I received " + test(50));
print("I received " + test(100));

yields:

Code:
> finally.ash

You gave me 50
Good enough!
I received 50
You gave me 100
I prefer 101
Good enough!
I received 100
 
Top