mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.1249: cannot export an abstract class
Problem: Cannot export an abstract class. (Ernie Rael) Solution: Add the EX_EXPORT flag to :abstract. (closes #11884)
This commit is contained in:
parent
53f54e49b7
commit
657aea7fc4
@ -3442,4 +3442,6 @@ EXTERN char e_using_super_not_in_child_class[]
|
|||||||
INIT(= N_("E1358: Using \"super\" not in a child class"));
|
INIT(= N_("E1358: Using \"super\" not in a child class"));
|
||||||
EXTERN char e_cannot_define_new_function_in_abstract_class[]
|
EXTERN char e_cannot_define_new_function_in_abstract_class[]
|
||||||
INIT(= N_("E1359: Cannot define a \"new\" function in an abstract class"));
|
INIT(= N_("E1359: Cannot define a \"new\" function in an abstract class"));
|
||||||
|
EXTERN char e_invalid_command_str_expected_str[]
|
||||||
|
INIT(= N_("E476: Invalid command: %s, expected %s"));
|
||||||
#endif
|
#endif
|
||||||
|
@ -128,7 +128,7 @@ EXCMD(CMD_aboveleft, "aboveleft", ex_wrongmodifier,
|
|||||||
EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
|
EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
|
||||||
ADDR_NONE),
|
ADDR_NONE),
|
||||||
EXCMD(CMD_abstract, "abstract", ex_class,
|
EXCMD(CMD_abstract, "abstract", 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_all, "all", ex_all,
|
EXCMD(CMD_all, "all", ex_all,
|
||||||
EX_BANG|EX_RANGE|EX_COUNT|EX_TRLBAR,
|
EX_BANG|EX_RANGE|EX_COUNT|EX_TRLBAR,
|
||||||
|
@ -164,6 +164,24 @@ def Test_class_basic()
|
|||||||
v9.CheckScriptSuccess(lines)
|
v9.CheckScriptSuccess(lines)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_class_interface_wrong_end()
|
||||||
|
var lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
abstract class SomeName
|
||||||
|
this.member = 'text'
|
||||||
|
endinterface
|
||||||
|
END
|
||||||
|
v9.CheckScriptFailure(lines, 'E476: Invalid command: endinterface, expected endclass')
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
export interface AnotherName
|
||||||
|
this.member: string
|
||||||
|
endclass
|
||||||
|
END
|
||||||
|
v9.CheckScriptFailure(lines, 'E476: Invalid command: endclass, expected endinterface')
|
||||||
|
enddef
|
||||||
|
|
||||||
def Test_class_member_initializer()
|
def Test_class_member_initializer()
|
||||||
var lines =<< trim END
|
var lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
@ -845,6 +863,20 @@ def Test_interface_basics()
|
|||||||
enddef
|
enddef
|
||||||
END
|
END
|
||||||
v9.CheckScriptSuccess(lines)
|
v9.CheckScriptSuccess(lines)
|
||||||
|
|
||||||
|
var imported =<< trim END
|
||||||
|
vim9script
|
||||||
|
export abstract class EnterExit
|
||||||
|
def Enter(): void
|
||||||
|
enddef
|
||||||
|
def Exit(): void
|
||||||
|
enddef
|
||||||
|
endclass
|
||||||
|
END
|
||||||
|
writefile(imported, 'XdefIntf2.vim', 'D')
|
||||||
|
|
||||||
|
lines[1] = " import './XdefIntf2.vim' as defIntf"
|
||||||
|
v9.CheckScriptSuccess(lines)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_class_implements_interface()
|
def Test_class_implements_interface()
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
1249,
|
||||||
/**/
|
/**/
|
||||||
1248,
|
1248,
|
||||||
/**/
|
/**/
|
||||||
|
@ -423,7 +423,7 @@ early_ret:
|
|||||||
char *wrong_name = is_class ? "endinterface" : "endclass";
|
char *wrong_name = is_class ? "endinterface" : "endclass";
|
||||||
if (checkforcmd(&p, wrong_name, is_class ? 5 : 4))
|
if (checkforcmd(&p, wrong_name, is_class ? 5 : 4))
|
||||||
{
|
{
|
||||||
semsg(_(e_invalid_command_str), line);
|
semsg(_(e_invalid_command_str_expected_str), line, end_name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user