0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.4114: Vim9: type checking for a funcref does not work for method

Problem:    Vim9: type checking for a funcref does not work for when it is
            used in a method.
Solution:   Pass the base to where the type is checked.
This commit is contained in:
Bram Moolenaar
2022-01-16 18:06:21 +00:00
parent dc98776f89
commit c84287d6d8
5 changed files with 31 additions and 8 deletions

View File

@@ -3136,6 +3136,14 @@ def Test_expr7_method_call()
var sorted = [3, 1, 2]
-> sort()
assert_equal([1, 2, 3], sorted)
def SetNumber(n: number)
g:number = n
enddef
const Setit = SetNumber
len('text')->Setit()
assert_equal(4, g:number)
unlet g:number
END
CheckDefAndScriptSuccess(lines)