Patch 9.0.1248

4 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 26, 2023, 3:37:45 PM1/26/23
to vim...@googlegroups.com

Patch 9.0.1248
Problem: Cannot export an interface. (Ernie Rael)
Solution: Add the EX_EXPORT flag to :interface. (closes #11884)
Files: src/ex_cmds.h, src/testdir/test_vim9_class.vim


*** ../vim-9.0.1247/src/ex_cmds.h 2023-01-22 21:14:32.621863614 +0000
--- src/ex_cmds.h 2023-01-26 20:28:10.934745059 +0000
***************
*** 758,764 ****
EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_interface, "interface", ex_class,
! EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_isearch, "isearch", ex_findpat,
EX_BANG|EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_LOCK_OK,
--- 758,764 ----
EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_interface, "interface", ex_class,
! EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
ADDR_NONE),
EXCMD(CMD_isearch, "isearch", ex_findpat,
EX_BANG|EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_LOCK_OK,
*** ../vim-9.0.1247/src/testdir/test_vim9_class.vim 2023-01-24 15:07:00.428562536 +0000
--- src/testdir/test_vim9_class.vim 2023-01-26 20:33:30.622684873 +0000
***************
*** 822,827 ****
--- 822,850 ----
endinterface
END
v9.CheckScriptFailure(lines, 'E1345: Not a valid command in an interface: return 5')
+
+ lines =<< trim END
+ vim9script
+ export interface EnterExit
+ def Enter(): void
+ def Exit(): void
+ endinterface
+ END
+ writefile(lines, 'XdefIntf.vim', 'D')
+
+ lines =<< trim END
+ vim9script
+ import './XdefIntf.vim' as defIntf
+ export def With(ee: defIntf.EnterExit, F: func)
+ ee.Enter()
+ try
+ F()
+ finally
+ ee.Exit()
+ endtry
+ enddef
+ END
+ v9.CheckScriptSuccess(lines)
enddef

def Test_class_implements_interface()
*** ../vim-9.0.1247/src/version.c 2023-01-26 14:14:18.839484388 +0000
--- src/version.c 2023-01-26 20:29:21.958731806 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1248,
/**/

--
Master: Boy, there is nothing more for you to learn
Student: I didn't know that!

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages