mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 9.0.2088: Vim9: still allows abstract static methods
Problem: Vim9: still allows abstract static methods (after v9.0.2084, v9.0.2085 and v9.0.2087) Solution: Disallow abstract static methods closes: #13479 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
ce3b0136c6
commit
5a53925a6e
@@ -5607,15 +5607,13 @@ def Test_abstract_method()
|
|||||||
v9.CheckSourceFailure(lines, 'E1371: Abstract must be followed by "def"', 3)
|
v9.CheckSourceFailure(lines, 'E1371: Abstract must be followed by "def"', 3)
|
||||||
|
|
||||||
# Use a static abstract method
|
# Use a static abstract method
|
||||||
# TODO: this does not fail, so skip it for now
|
lines =<< trim END
|
||||||
|
vim9script
|
||||||
# lines =<< trim END
|
abstract class A
|
||||||
# vim9script
|
abstract static def Foo(): number
|
||||||
# abstract class A
|
endclass
|
||||||
# abstract static def Foo(): number
|
END
|
||||||
# endclass
|
v9.CheckSourceFailure(lines, 'E1371: Abstract must be followed by "def"', 3)
|
||||||
# END
|
|
||||||
# v9.CheckSourceFailure(lines, 'E1371: Abstract must be followed by "def"', 3)
|
|
||||||
|
|
||||||
# Type mismatch between abstract method and concrete method
|
# Type mismatch between abstract method and concrete method
|
||||||
lines =<< trim END
|
lines =<< trim END
|
||||||
|
@@ -704,6 +704,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 */
|
||||||
|
/**/
|
||||||
|
2088,
|
||||||
/**/
|
/**/
|
||||||
2087,
|
2087,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -1557,13 +1557,6 @@ early_ret:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = skipwhite(pa + 8);
|
|
||||||
if (STRNCMP(p, "def", 3) != 0 && STRNCMP(p, "static", 6) != 0)
|
|
||||||
{
|
|
||||||
emsg(_(e_abstract_must_be_followed_by_def));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_class)
|
if (!is_class)
|
||||||
{
|
{
|
||||||
// "abstract" not supported in an interface
|
// "abstract" not supported in an interface
|
||||||
@@ -1577,6 +1570,13 @@ early_ret:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p = skipwhite(pa + 8);
|
||||||
|
if (STRNCMP(p, "def", 3) != 0)
|
||||||
|
{
|
||||||
|
emsg(_(e_abstract_must_be_followed_by_def));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
abstract_method = TRUE;
|
abstract_method = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user