lines =<< trim END
vim9script
- def g:TestFunc(f: func)
+ def g:TestFunc(F: func)
enddef
legacy call g:TestFunc({-> 0})
delfunc g:TestFunc
- def g:TestFunc(f: func(number))
+ def g:TestFunc(F: func(number))
enddef
legacy call g:TestFunc({nr -> 0})
delfunc g:TestFunc
return x + 1
enddef
- def G(g: func): dict<func>
- return {f: g}
+ def G(Fg: func): dict<func>
+ return {f: Fg}
enddef
def H(d: dict<func>): string
v9.CheckScriptSuccess(lines + ['echo H(G(F1))'])
v9.CheckScriptFailure(lines + ['echo H(G(F2))'], 'E1013:')
+
+ v9.CheckScriptFailure(lines + ['def SomeFunc(ff: func)', 'enddef'], 'E704:')
enddef
def Test_call_func_with_null()
if (type == NULL)
return FAIL;
fp->uf_arg_types[i] = type;
+ if (i < fp->uf_args.ga_len
+ && (type->tt_type == VAR_FUNC
+ || type->tt_type == VAR_PARTIAL)
+ && var_wrong_func_name(
+ ((char_u **)fp->uf_args.ga_data)[i], TRUE))
+ return FAIL;
}
}
}