mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.2.3783: confusing error for using a variable as a function
Problem: Confusing error for using a variable as a function. Solution: If a function is not found but there is a variable, give a more useful error. (issue #9310)
This commit is contained in:
@@ -1922,6 +1922,15 @@ def Test_script_var_shadows_command()
|
||||
CheckDefAndScriptFailure(lines, 'E1207:', 2)
|
||||
enddef
|
||||
|
||||
def Test_vim9script_call_wrong_type()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
var Time = 'localtime'
|
||||
Time()
|
||||
END
|
||||
CheckScriptFailure(lines, 'E1085:')
|
||||
enddef
|
||||
|
||||
def s:RetSome(): string
|
||||
return 'some'
|
||||
enddef
|
||||
|
Reference in New Issue
Block a user