]> granicus.if.org Git - vim/commitdiff
patch 7.4.1606 v7.4.1606
authorBram Moolenaar <Bram@vim.org>
Sat, 19 Mar 2016 17:52:29 +0000 (18:52 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 19 Mar 2016 17:52:29 +0000 (18:52 +0100)
Problem:    Having type() handle a Funcref that is or isn't a partial
            differently causes problems for existing scripts.
Solution:   Make type() return the same value. (Thinca)

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

index a2288f9f277b5305ef2e54a915207868ddcb4a3e..69969fe60991808ca92a91a493a6f25664324477 100644 (file)
@@ -20398,6 +20398,7 @@ f_type(typval_T *argvars, typval_T *rettv)
     {
        case VAR_NUMBER: n = 0; break;
        case VAR_STRING: n = 1; break;
+       case VAR_PARTIAL:
        case VAR_FUNC:   n = 2; break;
        case VAR_LIST:   n = 3; break;
        case VAR_DICT:   n = 4; break;
@@ -20411,7 +20412,6 @@ f_type(typval_T *argvars, typval_T *rettv)
             break;
        case VAR_JOB:     n = 8; break;
        case VAR_CHANNEL: n = 9; break;
-       case VAR_PARTIAL: n = 10; break;
        case VAR_UNKNOWN:
             EMSG2(_(e_intern2), "f_type(UNKNOWN)");
             n = -1;
index 0120d21216359f1b9807518679bc20b75fa0d025..10869f36a9e5125803680b4d1e361810d8480245 100644 (file)
@@ -942,6 +942,7 @@ func Test_type()
     call assert_equal(0, type(0))
     call assert_equal(1, type(""))
     call assert_equal(2, type(function("tr")))
+    call assert_equal(2, type(function("tr", [8])))
     call assert_equal(3, type([]))
     call assert_equal(4, type({}))
     call assert_equal(5, type(0.0))
index 2c4d24d0704ad61ca843c0fbfec1c19ba1f3e254..29d4d592b488bbbcd3bf6508bdb339b5196d94f9 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1606,
 /**/
     1605,
 /**/