patch 9.0.0219: cannot make a funcref with "s:func" in a def function
Problem: Cannot make a funcref with "s:func" in a def function in legacy
script.
Solution: Allow for using a lower case function name after "s:". (Kota Kato,
closes #10926)
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index d67dd55..5c75457 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1957,6 +1957,45 @@
g:listarg->assert_equal([1, 2, 3])
END
v9.CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ function s:func(num)
+ return a:num * 2
+ endfunction
+
+ def s:CallFuncref()
+ var Funcref = function('s:func')
+ Funcref(3)->assert_equal(6)
+ enddef
+ call s:CallFuncref()
+ END
+ v9.CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ function s:func(num)
+ return a:num * 2
+ endfunction
+
+ def s:CallFuncref()
+ var Funcref = function(s:func)
+ Funcref(3)->assert_equal(6)
+ enddef
+ call s:CallFuncref()
+ END
+ v9.CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ function s:func(num)
+ return a:num * 2
+ endfunction
+
+ def s:CallFuncref()
+ var Funcref = s:func
+ Funcref(3)->assert_equal(6)
+ enddef
+ call s:CallFuncref()
+ END
+ v9.CheckScriptSuccess(lines)
enddef
let SomeFunc = function('len')