patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Problem: Vim9: allowing use of "s:" leads to inconsistencies.
Solution: Disallow using "s:" in Vim9 script at the script level.
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index 87b8014..8399b69 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -2329,7 +2329,7 @@
v9.CheckDefAndScriptSuccess(lines)
enddef
-def Test_expr8_funcref()
+def Test_expr8funcref()
var lines =<< trim END
def RetNumber(): number
return 123
@@ -2344,7 +2344,7 @@
func g:GlobalFunc()
return 'global'
endfunc
- func s:ScriptFunc()
+ func ScriptFunc()
return 'script'
endfunc
def Test()
@@ -2353,7 +2353,7 @@
Ref = g:GlobalFunc
assert_equal('global', Ref())
- Ref = s:ScriptFunc
+ Ref = ScriptFunc
assert_equal('script', Ref())
Ref = ScriptFunc
assert_equal('script', Ref())
@@ -3347,7 +3347,7 @@
call v9.CheckDefAndScriptFailure(["var x = ¬exist"], 'E113:', 1)
call v9.CheckDefAndScriptFailure(["&grepprg = [343]"], ['E1012:', 'E730:'], 1)
- call v9.CheckDefExecAndScriptFailure(["echo s:doesnt_exist"], 'E121:', 1)
+ call v9.CheckDefExecAndScriptFailure(["echo s:doesnt_exist"], ['E121:', 'E1268:'], 1)
call v9.CheckDefExecAndScriptFailure(["echo g:doesnt_exist"], 'E121:', 1)
call v9.CheckDefAndScriptFailure(["echo a:somevar"], ['E1075:', 'E121:'], 1)