Hi list.

----------------------------------------
let s:f = function('type')
let s:fref = function('s:f')
" => <SNR>1_f
echo call(s:fref, ['x'])
" => E117: Unknown function: <SNR>1_f
----------------------------------------

In this script, function('s:f') should be an error.

----------------------------------------
let s:fref = function('s:f')
----------------------------------------


diff -r 2a798dca16bf src/eval.c
--- a/src/eval.c        Wed Aug 06 19:09:16 2014 +0200
+++ b/src/eval.c        Thu Aug 07 14:01:26 2014 +0900
@@ -157,6 +157,7 @@
 #define TFN_INT                1       /* internal function name OK */
 #define TFN_QUIET      2       /* no error messages */
 #define TFN_NO_AUTOLOAD        4       /* do not use script autoloading */
+#define TFN_NO_DEREF   8       /* do not deref function reference */
 
 /* Values for get_lval() flags argument: */
 #define GLV_QUIET      TFN_QUIET       /* no error messages */
@@ -22450,6 +22451,7 @@
  * TFN_INT:         internal function name OK
  * TFN_QUIET:       be quiet
  * TFN_NO_AUTOLOAD: do not use script autoloading
+ * TFN_NO_DEREF:    do not deref function reference
  * Advances "pp" to just after the function name (if no error).
  */
     static char_u *
@@ -22554,7 +22556,7 @@
        if (name == lv.ll_exp_name)
            name = NULL;
     }
-    else
+    else if (flags & TFN_NO_DEREF == 0)
     {
        len = (int)(end - *pp);
        name = deref_func_name(*pp, &len, flags & TFN_NO_AUTOLOAD);
@@ -22786,8 +22788,8 @@
     char_u  *p;
     int            n = FALSE;
 
-    p = trans_function_name(&nm, FALSE, TFN_INT|TFN_QUIET|TFN_NO_AUTOLOAD,
-                           NULL);
+    p = trans_function_name(&nm, FALSE,
+           TFN_INT|TFN_QUIET|TFN_NO_AUTOLOAD|TFN_NO_DEREF, NULL);
     nm = skipwhite(nm);
 
     /* Only accept "funcname", "funcname ", "funcname (..." and

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui