changeset 8633:80d78e1ab787 v7.4.1606

commit https://github.com/vim/vim/commit/953cc7fb139dc2ba8590f8b03a095b63f4e1208f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 19 18:52:29 2016 +0100 patch 7.4.1606 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)
author Christian Brabandt <cb@256bit.org>
date Sat, 19 Mar 2016 19:00:06 +0100
parents efdc2951aac4
children 416fa8415ada
files src/eval.c src/testdir/test_viml.vim src/version.c
diffstat 3 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -20398,6 +20398,7 @@ f_type(typval_T *argvars, typval_T *rett
     {
 	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 *rett
 	     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;
--- a/src/testdir/test_viml.vim
+++ b/src/testdir/test_viml.vim
@@ -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))
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1606,
+/**/
     1605,
 /**/
     1604,