Hi,

2016/7/23 Sat 21:01:44 UTC+9 Bram Moolenaar wrote:
> Ken Takata wrote:
> 
> > 2014/8/7 Thu 14:22:32 UTC+9 mattn wrote:
> > > 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')
> > > ----------------------------------------
> > 
> > How about this patch?
> > https://bitbucket.org/k_takata/vim-ktakata-mq/src/535170f9175dbfd922535d585a4b63736329b209/function-noderef.patch?at=default
> > 
> > This doesn't break existing tests.
> > I'm not sure which file should I add new tests for this to.
> 
> I think test_expr.vim is a good place.  But perhaps this test also needs
> to include another script to check passing a script-local function in a
> funcref to another script?

I added very simple test.

* function(s:f) works, but
* function('s:f') causes an error.

Please check the following patch:
https://bitbucket.org/k_takata/vim-ktakata-mq/src/95e9a10fea18993f6dcc710364c2908acb1e2caa/function-noderef.patch?at=default

Regards,
Ken Takata

-- 
-- 
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