CheckScriptFailure(['def Func(): string', 'return 1', 'enddef'], 'expected string but got number')
CheckScriptFailure(['def Func(): void', 'return "a"', 'enddef'], 'expected void but got string')
CheckScriptFailure(['def Func()', 'return "a"', 'enddef'], 'expected void but got string')
+
+ CheckScriptFailure(['def Func(): list', 'return []', 'enddef'], 'E1008:')
+ CheckScriptFailure(['def Func(): dict', 'return {}', 'enddef'], 'E1008:')
enddef
def Test_arg_type_wrong()
emsg(_("E1007: No white space allowed before <"));
else
emsg(_("E1008: Missing <type>"));
- return NULL;
+ return type;
}
*arg = skipwhite(*arg + 1);
member_type = parse_type(arg, type_list);
if (member_type == NULL)
- return NULL;
+ return type;
*arg = skipwhite(*arg);
if (**arg != '>')
{
emsg(_("E1009: Missing > after type"));
- return NULL;
+ return type;
}
++*arg;