When executing a function, and "return" is encountered within an "eval" statement, yash does not return from the function; instead, it only stops executing the "eval" and continues the function after it. Every other shell (bash, *ksh*, zsh, (d)ash, etc.) returns from the function.
Example of real-life use case: unset some temporary variables, then return with the exit code of the command preceding the 'eval'. Using 'eval' removes the need to store the exit status in a variable. This bug makes it harder to do this in yash -- eval does exit with the saved status, but then in yash, another "return" is needed after the eval.
When executing a function, and "return" is encountered within an "eval" statement, yash does not return from the function; instead, it only stops executing the "eval" and continues the function after it. Every other shell (bash, *ksh*, zsh, (d)ash, etc.) returns from the function.
Actual output:
Expected output:
Example of real-life use case: unset some temporary variables, then return with the exit code of the command preceding the 'eval'. Using 'eval' removes the need to store the exit status in a variable. This bug makes it harder to do this in yash -- eval does exit with the saved status, but then in yash, another "return" is needed after the eval.