On Wednesday, March 16, 2016 at 10:43:13 AM UTC-4, Bram Moolenaar wrote:
> Kent Sibilev wrote:
>
> > On Tuesday, March 15, 2016 at 2:33:55 PM UTC-4, Bram Moolenaar wrote:
> > > Patch 7.4.1577
> > > Problem: Cannot pass "dict.Myfunc" around as a partial.
> > > Solution: Create a partial when expected.
> > > Files: src/eval.c, src/testdir/test_partial.vim
> > >
> >
> > This change doesn't allow functions like this:
> >
> > function! s:cache_clear(...) dict
> >
> > function! rails#cache_clear(...)
> >
> > to be defined at the same time. Any particular reason for this, cause
> > this change breaks vim-rails plugin.
>
> The patch should not change anything about what functions you can
> define.
>
> What is the error? Can you make a small example that fails?
Here is the small script to reproduce:
function s:cache_clear(...) dict
return self.name
endfunction
function! s:function(name)
return function(substitute(a:name,'^s:',matchstr(expand('<sfile>'),
'<SNR>\d\+_'),''))
endfunction
let s:obj = {'name': 'cache'}
let s:obj['clear'] = s:function('s:cache_clear')
" this works
echo s:obj.clear()
" this fails with E924
echo call(s:obj.clear, [], s:obj)
--
--
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.