-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Description
Describe the bug
Vim doesn't throw any errors when a const
list is filtered with filter()
.
According to :h :const
, const
is like lockvar 1 {name}
. Further down the help page it says that when locking a list with lockvar 1
items cannot be added or removed from the list.
To Reproduce
- Run
vim --clean -S test.vim
function Test() abort
const test = range(10)
return filter(test, 'v:val % 2 == 0')
endfunction
echo Test()
- Result:
[0, 2, 4, 6, 8]
Expected behavior
I would have expected Vim to throw an error when items are being removed from a const
list.
Environment
Vim version 8.2.1464
Metadata
Metadata
Assignees
Labels
No labels