0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 9.0.1801: Vim9 instanceof() fails in a def func

Problem:  Vim9 instanceof() fails in a def func
Solution: allow Objects in compile time check

closes: #12907

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
Yegappan Lakshmanan
2023-08-27 19:08:40 +02:00
committed by Christian Brabandt
parent 6a3897232a
commit b49ad28d73
4 changed files with 43 additions and 1 deletions

View File

@@ -2436,6 +2436,20 @@ def Test_instanceof()
assert_true(instanceof(b3, Mix1))
assert_false(instanceof(b3, []))
assert_true(instanceof(b3, [Base1, Base2, Intf1]))
def Foo()
var a1 = Base1.new()
var a2 = Base2.new()
var a3 = Base3.new()
assert_true(instanceof(a1, Base1))
assert_true(instanceof(a2, Base1))
assert_false(instanceof(a1, Base2))
assert_true(instanceof(a3, Mix1))
assert_false(instanceof(a3, []))
assert_true(instanceof(a3, [Base1, Base2, Intf1]))
enddef
Foo()
END
v9.CheckScriptSuccess(lines)
enddef