diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/nvim/eval.c | 15 | ||||
| -rw-r--r-- | src/nvim/testdir/Makefile | 3 | ||||
| -rw-r--r-- | src/nvim/testdir/test_alot.vim | 4 | ||||
| -rw-r--r-- | src/nvim/testdir/test_assign.vim | 9 | ||||
| -rw-r--r-- | src/nvim/version.c | 4 | 
5 files changed, 16 insertions, 19 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 47d44b148a..a43a389478 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -18886,19 +18886,6 @@ set_var (          || tv_check_lock(v->di_tv.v_lock, name, false)) {        return;      } -    if (v->di_tv.v_type != tv->v_type -        && !((v->di_tv.v_type == VAR_STRING -              || v->di_tv.v_type == VAR_NUMBER) -             && (tv->v_type == VAR_STRING -                 || tv->v_type == VAR_NUMBER)) -        && !((v->di_tv.v_type == VAR_NUMBER -              || v->di_tv.v_type == VAR_FLOAT) -             && (tv->v_type == VAR_NUMBER -                 || tv->v_type == VAR_FLOAT)) -        ) { -      EMSG2(_("E706: Variable type mismatch for: %s"), name); -      return; -    }      // Handle setting internal v: variables separately where needed to      // prevent changing the type. @@ -18908,7 +18895,7 @@ set_var (          if (copy || tv->v_type != VAR_STRING)            v->di_tv.vval.v_string = vim_strsave(get_tv_string(tv));          else { -          /* Take over the string to avoid an extra alloc/free. */ +          // Take over the string to avoid an extra alloc/free.            v->di_tv.vval.v_string = tv->vval.v_string;            tv->vval.v_string = NULL;          } diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 4b0b5e8d26..30f5170565 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -33,14 +33,11 @@ SCRIPTS := \  # Tests using runtest.vim.vim.  # Keep test_alot*.res as the last one, sort the others.  NEW_TESTS = \ -	    test_cursor_func.res \  	    test_hardcopy.res \  	    test_help_tagjump.res \  	    test_langmap.res \ -	    test_menu.res \  	    test_syntax.res \  	    test_timers.res \ -	    test_unlet.res \  	    test_viml.res \  	    test_alot.res diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 1d1da94bac..ad9b2cce8b 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -1,3 +1,7 @@  " A series of tests that can run in one Vim invocation.  " This makes testing go faster, since Vim doesn't need to restart. +source test_assign.vim +source test_cursor_func.vim +source test_menu.vim +source test_unlet.vim diff --git a/src/nvim/testdir/test_assign.vim b/src/nvim/testdir/test_assign.vim new file mode 100644 index 0000000000..3d2e7a8998 --- /dev/null +++ b/src/nvim/testdir/test_assign.vim @@ -0,0 +1,9 @@ +" Test for assignment + +func Test_no_type_checking() +  let v = 1 +  let v = [1,2,3] +  let v = {'a':1, 'b':2} +  let v = 3.4 +  let v = 'hello' +endfunc diff --git a/src/nvim/version.c b/src/nvim/version.c index 87bbb12b50..70c6af2a12 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -151,9 +151,9 @@ static int included_patches[] = {    1551,    1550,    // 1549, -  // 1548, +  1548,    // 1547, -  // 1546, +  1546,    // 1545 NA    // 1544 NA    // 1543 NA  | 
