Mercurial > vim
diff src/testdir/test_vim9_class.vim @ 31865:86ed5031ff2b v9.0.1265
patch 9.0.1265: using an interface method may give a compilation error
Commit: https://github.com/vim/vim/commit/b8bebd0cd78679162228ee08265c9a5b3a409e1c
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 30 20:24:23 2023 +0000
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 30 Jan 2023 21:30:03 +0100 |
parents | dbec60b8c253 |
children | ecfabcaafc0b |
line wrap: on
line diff
--- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -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()