https://github.com/oilshell/oil/issues/709
Summary of problems:
1. The "if myfunc" problem -- error checking is skipped. This is specified by POSIX, but it's undesirable.
2. The f() { test -d /tmp && echo "exists" } problem. The exit code of the function is probably not what you expect!
3. the local x=$(false) problem. This happens in all shells because of the definition of $?. (local is a shell builtin with its own exit code, not part of the language) This one is already fixed with shopt -s more_errexit in Oil.
4. the x=$(false) problem. This is a bash problem with command substitution. For example, dash and zsh don't have this problem. Test case:
bash -c 'set -e; x=$(false); echo should not get here'
Newer versions of bash fix it with inherit_errexit. Oil also implements inherit_errexit and turns it on by default! (in Oil, not OSH)-----
So 1 and 2 relate to the confusing combination of shell functions and errexit.
And 3 and 4 relate to command subs. Oil has fixed these with opt-in OSH shell options (on by default in Oil), but not 1 and 2.
If you know of any other problems, please chime in on the bug!