Panic when evaluating the empty process expansion $() or @()
Reproduction: Run
$ let string = $()
That is a rather contrived example, but suppose a user is outside of a git directory and runs the following.
$ let string = $(git rev-parse --abbrev-ref HEAD ^> /dev/null)
Or runs the following
echo "$(cat <somefile> | grep <word that isn't found>)"
Since the command does not generate any output, these are equivalent to $()
.
Expected behavior:
$string
should contain an empty string.
Actual behavior: Panic.
Build information:
drobertson:~# ion --version
ion 1.0.5 (x86_64-unknown-linux-gnu)
rev bfe7dffe507bb2565cf9feb92b46da6059b7757b
drobertson:~# rustc --version
rustc 1.23.0-nightly (827cb0d61 2017-11-26)
drobertson:~# uname -r
4.13.11-gentoo
Possibly related to: #607 (closed)