patch 8.2.4526: Vim9: cannot set variables to a null value
Problem: Vim9: cannot set variables to a null value.
Solution: Add null_list, null_job, etc.
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim
index 40c1701..5f2020d 100644
--- a/src/testdir/test_expr.vim
+++ b/src/testdir/test_expr.vim
@@ -157,12 +157,28 @@
func Test_loop_over_null_list()
let lines =<< trim END
- VAR null_list = test_null_list()
- for i in null_list
+ VAR nulllist = test_null_list()
+ for i in nulllist
call assert_report('should not get here')
endfor
END
call v9.CheckLegacyAndVim9Success(lines)
+
+ let lines =<< trim END
+ var nulllist = null_list
+ for i in nulllist
+ call assert_report('should not get here')
+ endfor
+ END
+ call v9.CheckDefAndScriptSuccess(lines)
+
+ let lines =<< trim END
+ let nulllist = null_list
+ for i in nulllist
+ call assert_report('should not get here')
+ endfor
+ END
+ call v9.CheckScriptFailure(lines, 'E121: Undefined variable: null_list')
endfunc
func Test_setreg_null_list()