patch 7.4.1546
Problem: Sticky type checking is more annoying than useful.
Solution: Remove the error for changing a variable type.
diff --git a/src/eval.c b/src/eval.c
index f4843e2..765d9b9 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -22091,22 +22091,6 @@
if (var_check_ro(v->di_flags, name, FALSE)
|| 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))
-#ifdef FEAT_FLOAT
- && !((v->di_tv.v_type == VAR_NUMBER
- || v->di_tv.v_type == VAR_FLOAT)
- && (tv->v_type == VAR_NUMBER
- || tv->v_type == VAR_FLOAT))
-#endif
- )
- {
- EMSG2(_("E706: Variable type mismatch for: %s"), name);
- return;
- }
/*
* Handle setting internal v: variables separately where needed to
diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim
index 46be515..6071756 100644
--- a/src/testdir/test_alot.vim
+++ b/src/testdir/test_alot.vim
@@ -1,6 +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_backspace_opt.vim
source test_cursor_func.vim
source test_delete.vim
diff --git a/src/testdir/test_assign.vim b/src/testdir/test_assign.vim
new file mode 100644
index 0000000..c1f036a
--- /dev/null
+++ b/src/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/version.c b/src/version.c
index 0652ab8..fc9cebe 100644
--- a/src/version.c
+++ b/src/version.c
@@ -744,6 +744,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1546,
+/**/
1545,
/**/
1544,