Except that this is *inside* arithmetic context. Bash is definitely doing something wrong here:
dualbus@hp:~$ for sh in bash zsh ksh93 mksh dash posh; do $sh -c 'echo $0 $((~0))' $sh; done bash: /home/dualbus: syntax error: operand expected (error token is "/home/dualbus") zsh -1 ksh93 -1 mksh -1 dash -1 posh -1