0
0
mirror of https://github.com/vim/vim.git synced 2025-11-04 09:47:15 -05:00

patch 8.2.0517: Vim9: cannot separate "func" and "func(): void"

Problem:    Vim9: cannot separate "func" and "func(): void".
Solution:   Use VAR_ANY for "any" and VAR_UNKNOWN for "no type".
This commit is contained in:
Bram Moolenaar
2020-04-05 21:38:23 +02:00
parent f87a0400fd
commit 4c68375057
13 changed files with 88 additions and 29 deletions

View File

@@ -386,6 +386,27 @@ def Test_func_type()
Ref1 = FuncNoArgNoRet
Ref1()
assert_equal(11, funcResult)
let Ref2: func
funcResult = 0
Ref2 = FuncNoArgNoRet
Ref2()
assert_equal(11, funcResult)
funcResult = 0
Ref2 = FuncOneArgNoRet
Ref2(12)
assert_equal(12, funcResult)
funcResult = 0
Ref2 = FuncNoArgRetNumber
assert_equal(1234, Ref2())
assert_equal(22, funcResult)
funcResult = 0
Ref2 = FuncOneArgRetNumber
assert_equal(13, Ref2(13))
assert_equal(13, funcResult)
enddef
def Test_func_type_fails()