mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.1373: Vim9: no error for assigning to non-existing script var
Problem: Vim9: no error for assigning to non-existing script var. Solution: Check that in Vim9 script the variable was defined. (closes #6630)
This commit is contained in:
@@ -112,6 +112,15 @@ def Test_assignment()
|
||||
call CheckDefFailure(['let s:var = 123'], 'E1101:')
|
||||
call CheckDefFailure(['let s:var: number'], 'E1101:')
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def SomeFunc()
|
||||
s:var = 123
|
||||
enddef
|
||||
defcompile
|
||||
END
|
||||
call CheckScriptFailure(lines, 'E1089:')
|
||||
|
||||
g:inc_counter += 1
|
||||
assert_equal(2, g:inc_counter)
|
||||
|
||||
|
Reference in New Issue
Block a user