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

patch 9.0.1265: using an interface method may give a compilation error

Problem:    Using an interface method may give a compilation error.
Solution:   Do not try to compile the body of a method of an interface.
            (closes #11885)
This commit is contained in:
Bram Moolenaar
2023-01-30 20:24:23 +00:00
parent eb45ad25ab
commit b8bebd0cd7
3 changed files with 30 additions and 1 deletions

View File

@@ -1049,6 +1049,23 @@ def Test_call_interface_method()
unlet g:result
END
v9.CheckScriptSuccess(lines)
# No class that implements the interface.
lines =<< trim END
vim9script
interface IWithEE
def Enter(): any
def Exit(): void
endinterface
def With1(ee: IWithEE, F: func)
var r = ee.Enter()
enddef
defcompile
END
v9.CheckScriptSuccess(lines)
enddef
def Test_class_used_as_type()