use_string = TRUE;
}
- if (((use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL)
- || is_funcref))
+ if ((use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL) || is_funcref)
{
name = s;
trans_name = trans_function_name(&name, FALSE,
s = NULL;
}
- if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s)))
+ if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s))
+ || (is_funcref && trans_name == NULL))
EMSG2(_(e_invarg2), s);
/* Don't check an autoload name for existence here. */
else if (trans_name != NULL && (is_funcref
call assert_equal(1, OneByRef())
let OneByRef = funcref('One')
call assert_equal(2, OneByRef())
+ call assert_fails('echo funcref("{")', 'E475:')
endfunc
func Test_setmatches()