Add string to reserved keywords

Since `string match` now creates variables, wrapping `string`
necessarily breaks things, so we need to disallow it.

See #7459, #7509.
This commit is contained in:
Fabian Homborg
2020-12-06 15:31:04 +01:00
parent 9140fc7931
commit aa895645dd
2 changed files with 11 additions and 3 deletions

View File

@@ -681,3 +681,11 @@ echo $status
yes | string replace -q y n
echo $status
# CHECK: 0
# `string` can't be wrapped properly anymore, since `string match` creates variables:
function string
builtin string $argv
end
# CHECKERR: checks/string.fish (line {{\d+}}): function: The name 'string' is reserved, and cannot be used as a function name
# CHECKERR: function string
# CHECKERR: ^