1
0
forked from aniani/vim

patch 9.1.1002: Vim9: unknown func error with interface declaring func var

Problem:  Vim9: unknown function error with interface declaring a
          function variable (lifepillar)
Solution: Use correct instruction for getting interface member variables
          (Yegappan Lakshmanan)

fixes: #16345
closes: #16421

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2025-01-11 09:39:01 +01:00
committed by Christian Brabandt
parent 668e9f2403
commit c10342da44
4 changed files with 61 additions and 2 deletions

View File

@@ -7257,6 +7257,31 @@ def Test_interface_extends_with_dup_members()
v9.CheckSourceSuccess(lines)
enddef
" Test for implementing an interface with different ordering for the interface
" member variables.
def Test_implement_interface_with_different_variable_order()
var lines =<< trim END
vim9script
interface IX
var F: func(): string
endinterface
class X implements IX
var x: number
var F: func(): string = () => 'ok'
endclass
def Foo(ix: IX): string
return ix.F()
enddef
var x0 = X.new(0)
assert_equal('ok', Foo(x0))
END
v9.CheckSourceSuccess(lines)
enddef
" Test for using "any" type for a variable in a sub-class while it has a
" concrete type in the interface
def Test_implements_using_var_type_any()