1
0
forked from aniani/vim

patch 9.0.0444: trying to declare g:variable gives confusing error

Problem:    Trying to declare g:variable gives confusing error.
Solution:   Give a better error message. (closes #11108)
This commit is contained in:
Bram Moolenaar
2022-09-11 15:14:05 +01:00
parent cce82a55b8
commit 9510d22463
9 changed files with 51 additions and 20 deletions

View File

@@ -4241,13 +4241,12 @@ func Test_misplaced_type()
endfunc
def Run_Test_misplaced_type()
writefile(['let g:somevar = "asdf"'], 'XTest_misplaced_type')
writefile(['let g:somevar = "asdf"'], 'XTest_misplaced_type', 'D')
var buf = g:RunVimInTerminal('-S XTest_misplaced_type', {'rows': 6})
term_sendkeys(buf, ":vim9cmd echo islocked('g:somevar: string')\<CR>")
term_sendkeys(buf, ":vim9cmd echo islocked('somevar: string')\<CR>")
g:VerifyScreenDump(buf, 'Test_misplaced_type', {})
g:StopVimInTerminal(buf)
delete('XTest_misplaced_type')
enddef
" Ensure echo doesn't crash when stringifying empty variables.