mirror of
https://github.com/vim/vim.git
synced 2025-11-10 10:47:23 -05:00
patch 9.0.0703: failing check for argument type for const any
Problem: Failing check for argument type for const any. Solution: Check for any type properly. (closes #11316)
This commit is contained in:
@@ -305,6 +305,25 @@ def Test_const()
|
||||
assert_equal(v:t_number, type(foo.bar))
|
||||
END
|
||||
v9.CheckDefAndScriptSuccess(lines)
|
||||
|
||||
# also when used as a builtin function argument
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
|
||||
def SorterFunc(lhs: dict<string>, rhs: dict<string>): number
|
||||
return lhs.name <# rhs.name ? -1 : 1
|
||||
enddef
|
||||
|
||||
def Run(): void
|
||||
var list = [{name: "3"}, {name: "2"}]
|
||||
const Sorter = get({}, "unknown", SorterFunc)
|
||||
sort(list, Sorter)
|
||||
assert_equal([{name: "2"}, {name: "3"}], list)
|
||||
enddef
|
||||
|
||||
Run()
|
||||
END
|
||||
v9.CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_const_bang()
|
||||
|
||||
Reference in New Issue
Block a user