# HG changeset patch # User Bram Moolenaar # Date 1589661903 -7200 # Node ID 61d2eb1413f271a950d981550b44a4bc51970458 # Parent e690ca8ee51c59c90c3b9d8f1875319e414bda5e patch 8.2.0772: Vim9: some variable initializations not tested Commit: https://github.com/vim/vim/commit/df671b4629a0c6451c067cafd2534b7261f41277 Author: Bram Moolenaar Date: Sat May 16 22:33:33 2020 +0200 patch 8.2.0772: Vim9: some variable initializations not tested Problem: Vim9: some variable initializations not tested. Solution: Add a few more tests diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1736,6 +1736,8 @@ def Test_let_func_call() return 'this' endfunc let val: string = GetValue() + " env var is always a string + let env = $TERM END writefile(lines, 'Xfinished') source Xfinished @@ -1752,13 +1754,40 @@ def Test_let_missing_type() func GetValue() return 'this' endfunc - let val = GetValue() + let val = GetValue() + END + CheckScriptFailure(lines, 'E1091:') + + lines =<< trim END + vim9script + func GetValue() + return 'this' + endfunc + let val = [GetValue()] END CheckScriptFailure(lines, 'E1091:') lines =<< trim END vim9script - let var = g:unkown + func GetValue() + return 'this' + endfunc + let val = {GetValue(): 123} + END + CheckScriptFailure(lines, 'E1091:') + + lines =<< trim END + vim9script + func GetValue() + return 'this' + endfunc + let val = {'a': GetValue()} + END + CheckScriptFailure(lines, 'E1091:') + + lines =<< trim END + vim9script + let var = g:unknown END CheckScriptFailure(lines, 'E1091:') diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 772, +/**/ 771, /**/ 770,