diff --git a/src/eval.c b/src/eval.c index 506932403a..85f209221a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -21705,6 +21705,7 @@ handle_subscript( /* Turn "dict.Func" into a partial for "Func" with "dict". */ if (pt != NULL) { + pt->pt_refcount = 1; pt->pt_dict = selfdict; selfdict = NULL; pt->pt_name = rettv->vval.v_string; diff --git a/src/testdir/test_partial.vim b/src/testdir/test_partial.vim index ddc85e0ef9..acba887cbf 100644 --- a/src/testdir/test_partial.vim +++ b/src/testdir/test_partial.vim @@ -68,3 +68,17 @@ func Test_partial_implicit() call assert_fails('call function(dict.MyFunc, ["bbb"], dict)', 'E924:') endfunc + +fun InnerCall(funcref) + return a:funcref +endfu + +fun OuterCall() + let opt = { 'func' : function('sin') } + call InnerCall(opt.func) +endfu + +func Test_function_in_dict() + call OuterCall() +endfunc + diff --git a/src/version.c b/src/version.c index e4c3412d77..cb291581d2 100644 --- a/src/version.c +++ b/src/version.c @@ -748,6 +748,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1580, /**/ 1579, /**/