diff options
| author | Michael Ennen <mike.ennen@gmail.com> | 2016-10-26 12:23:49 -0700 |
|---|---|---|
| committer | James McCoy <jamessan@jamessan.com> | 2016-12-12 10:17:35 -0500 |
| commit | 529482d6844474f6eab9feed5162008b652fd931 (patch) | |
| tree | 804712cd068f0b12bd92307969f1b77b641cb86e /src/nvim/testdir | |
| parent | f90551b0e67c1389cb91dfedbe9a111c677e67e2 (diff) | |
| download | rneovim-529482d6844474f6eab9feed5162008b652fd931.tar.gz rneovim-529482d6844474f6eab9feed5162008b652fd931.tar.bz2 rneovim-529482d6844474f6eab9feed5162008b652fd931.zip | |
vim-patch:7.4.1577
Problem: Cannot pass "dict.Myfunc" around as a partial.
Solution: Create a partial when expected.
https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_partial.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_partial.vim b/src/nvim/testdir/test_partial.vim index abb655841b..caae1a8cb1 100644 --- a/src/nvim/testdir/test_partial.vim +++ b/src/nvim/testdir/test_partial.vim @@ -49,3 +49,21 @@ func Test_partial_dict() call assert_equal("hello/xxx/yyy", Cb("xxx", "yyy")) call assert_fails('Cb("fff")', 'E492:') endfunc + +func Test_partial_implicit() + let dict = {'name': 'foo'} + func dict.MyFunc(arg) dict + return self.name . '/' . a:arg + endfunc + + call assert_equal('foo/bar', dict.MyFunc('bar')) + + call assert_fails('let func = dict.MyFunc', 'E704:') + let Func = dict.MyFunc + call assert_equal('foo/aaa', Func('aaa')) + + let Func = function(dict.MyFunc, ['bbb']) + call assert_equal('foo/bbb', Func()) + + call assert_fails('call function(dict.MyFunc, ["bbb"], dict)', 'E924:') +endfunc |