INIT(= N_("E1233: exists_compiled() can only be used in a :def function"));
EXTERN char e_legacy_must_be_followed_by_command[]
INIT(= N_("E1234: legacy must be followed by a command"));
+EXTERN char e_function_reference_is_not_set[]
+ INIT(= N_("E1235: Function reference is not set"));
assert_equal('ooooo', RepeatFunc(5))
END
CheckDefAndScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+ def Foo(Parser: any)
+ enddef
+ var Expr: func(dict<any>): dict<any>
+ const Call = Foo(Expr)
+ END
+ CheckScriptFailure(lines, 'E1235:')
enddef
def Test_cmd_modifier()
type_T *actual_type;
int res = FAIL;
+ // For some values there is no type, assume an error will be given later
+ // for an invalid value.
+ if ((actual_tv->v_type == VAR_FUNC && actual_tv->vval.v_string == NULL)
+ || (actual_tv->v_type == VAR_PARTIAL
+ && actual_tv->vval.v_partial == NULL))
+ {
+ emsg(_(e_function_reference_is_not_set));
+ return FAIL;
+ }
+
ga_init2(&type_list, sizeof(type_T *), 10);
actual_type = typval2type(actual_tv, get_copyID(), &type_list, TRUE);
if (actual_type != NULL)