patch 8.2.2734: Vim9: cannot use legacy script-local var from :def function
Problem: Vim9: cannot use legacy script-local var from :def function.
Solution: Do not insist on using "s:" prefix. (closes #8076)
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index 4e1e3d7..c86379e 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -2714,6 +2714,21 @@
CheckDefAndScriptFailure(lines, 'E1050:')
enddef
+def Test_expr7_legacy_script()
+ var lines =<< trim END
+ let s:legacy = 'legacy'
+ def GetLocal(): string
+ return legacy
+ enddef
+ def GetLocalPrefix(): string
+ return s:legacy
+ enddef
+ call assert_equal('legacy', GetLocal())
+ call assert_equal('legacy', GetLocalPrefix())
+ END
+ CheckScriptSuccess(lines)
+enddef
+
def Echo(arg: any): string
return arg
enddef