1
0
forked from aniani/vim

patch 9.0.2085: Vim9: abstract can be used in interface

Problem:  Vim9: abstract can be used in interface
Solution: Disallow the use of abstract in an interface

fixes: #13456
closes: #13464

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2023-11-02 20:57:32 +01:00
committed by Christian Brabandt
parent ef9e3f8924
commit 2b358adde0
4 changed files with 44 additions and 20 deletions

View File

@@ -5567,7 +5567,26 @@ def Test_abstract_method()
enddef
endclass
END
v9.CheckSourceSuccess(lines)
v9.CheckSourceFailure(lines, 'E1404: Abstract cannot be used in an interface', 3)
# Use abstract static method in an interface
lines =<< trim END
vim9script
interface A
abstract static def Foo()
enddef
endinterface
END
v9.CheckSourceFailure(lines, 'E1404: Abstract cannot be used in an interface', 3)
# Use abstract static variable in an interface
lines =<< trim END
vim9script
interface A
abstract static foo: number = 10
endinterface
END
v9.CheckSourceFailure(lines, 'E1404: Abstract cannot be used in an interface', 3)
# Abbreviate the "abstract" keyword
lines =<< trim END