1
0
forked from aniani/vim

patch 9.0.1248: cannot export an interface

Problem:    Cannot export an interface. (Ernie Rael)
Solution:   Add the EX_EXPORT flag to :interface. (closes #11884)
This commit is contained in:
Bram Moolenaar
2023-01-26 20:36:56 +00:00
parent 870219c58c
commit 53f54e49b7
3 changed files with 26 additions and 1 deletions

View File

@@ -758,7 +758,7 @@ EXCMD(CMD_intro, "intro", ex_intro,
EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK, EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE), ADDR_NONE),
EXCMD(CMD_interface, "interface", ex_class, EXCMD(CMD_interface, "interface", ex_class,
EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK, EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
ADDR_NONE), ADDR_NONE),
EXCMD(CMD_isearch, "isearch", ex_findpat, EXCMD(CMD_isearch, "isearch", ex_findpat,
EX_BANG|EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_LOCK_OK, EX_BANG|EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_LOCK_OK,

View File

@@ -822,6 +822,29 @@ def Test_interface_basics()
endinterface endinterface
END END
v9.CheckScriptFailure(lines, 'E1345: Not a valid command in an interface: return 5') 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 enddef
def Test_class_implements_interface() def Test_class_implements_interface()

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1248,
/**/ /**/
1247, 1247,
/**/ /**/