0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 7.4.2134

Problem:    No error for using function() badly.
Solution:   Check for passing wrong function name. (Ken Takata)
This commit is contained in:
Bram Moolenaar
2016-07-31 14:11:58 +02:00
parent fc1f2015e8
commit b54c3ff317
7 changed files with 25 additions and 10 deletions

View File

@@ -172,3 +172,10 @@ func Test_substitute_expr_arg()
call assert_fails("call substitute('xxx', '.', {m -> string(extend(m, ['x']))}, '')", 'E742:')
call assert_fails("call substitute('xxx', '.', {m -> string(remove(m, 1))}, '')", 'E742:')
endfunc
func Test_function_with_funcref()
let s:f = function('type')
let s:fref = function(s:f)
call assert_equal(v:t_string, s:fref('x'))
call assert_fails("call function('s:f')", 'E700:')
endfunc