]> granicus.if.org Git - vim/commitdiff
patch 7.4.1645 v7.4.1645
authorBram Moolenaar <Bram@vim.org>
Thu, 24 Mar 2016 20:42:09 +0000 (21:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 24 Mar 2016 20:42:09 +0000 (21:42 +0100)
Problem:    When a dict contains a partial it can't be redefined as a
            function. (Nikolai Pavlov)
Solution:   Remove the partial when overwriting with a function.

src/eval.c
src/testdir/test_partial.vim
src/version.c

index 453756217715052fe339af93fe6c6c95237b89f8..db6ef9d5d874ada7ca82d5bc95f6f565b59948ea 100644 (file)
@@ -23455,7 +23455,8 @@ ex_function(exarg_T *eap)
        else
            arg = fudi.fd_newkey;
        if (arg != NULL && (fudi.fd_di == NULL
-                                    || fudi.fd_di->di_tv.v_type != VAR_FUNC))
+                                    || (fudi.fd_di->di_tv.v_type != VAR_FUNC
+                                && fudi.fd_di->di_tv.v_type != VAR_PARTIAL)))
        {
            if (*arg == K_SPECIAL)
                j = 3;
index 75cc492515f4c07887ea9829f93d63ada8975bd1..1fe67eabcf1294f6b0ba7300c3fad315d1b0db13 100644 (file)
@@ -193,3 +193,16 @@ func Test_tostring()
     call assert_true(v:false, v:exception)
   endtry
 endfunc
+
+func Test_redefine_dict_func()
+  let d = {}
+  function d.test4()
+  endfunction
+  let d.test4 = d.test4
+  try
+    function! d.test4(name)
+    endfunction
+  catch
+    call assert_true(v:errmsg, v:exception)
+  endtry
+endfunc
index b90a0d0a99f0c718410783914b996ad963f66f4e..dd9b5c2850b3d06eae06ee97df24386e5e1a232b 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1645,
 /**/
     1644,
 /**/