patch 9.0.2084: Vim9: abstract static methods are possible

Problem:  Vim9: abstract static methods are possible
Solution: Disallow abstract static methods

fixes: #13462
closes: #13466

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim
index a8d0fd6..b3d9841 100644
--- a/src/testdir/test_vim9_class.vim
+++ b/src/testdir/test_vim9_class.vim
@@ -35,7 +35,7 @@
   END
   v9.CheckSourceFailure(lines, 'E475: Invalid argument: noclass Something', 2)
 
-  # Only the completed word "class" should be recognized
+  # Only the complete word "class" should be recognized
   lines =<< trim END
     vim9script
     abstract classy Something
@@ -4186,8 +4186,8 @@
 def Test_lockvar_islocked()
   # Can't lock class/object variable
   # Lock class/object variable's value
-  # Lock item of variabl's value (a list item)
-  # varible is at index 1 within class/object
+  # Lock item of variable's value (a list item)
+  # variable is at index 1 within class/object
   var lines =<< trim END
     vim9script
 
@@ -5585,7 +5585,7 @@
       abstract this.val = 10
     endclass
   END
-  v9.CheckSourceFailure(lines, 'E1371: Abstract must be followed by "def" or "static"', 3)
+  v9.CheckSourceFailure(lines, 'E1371: Abstract must be followed by "def"', 3)
 
   # Use a static abstract method
   lines =<< trim END
@@ -5593,14 +5593,8 @@
     abstract class A
       abstract static def Foo(): number
     endclass
-    class B extends A
-      static def Foo(): number
-        return 4
-      enddef
-    endclass
-    assert_equal(4, B.Foo())
   END
-  v9.CheckSourceSuccess(lines)
+  v9.CheckSourceFailure(lines, 'E1371: Abstract must be followed by "def"', 3)
 
   # Type mismatch between abstract method and concrete method
   lines =<< trim END
@@ -5616,17 +5610,6 @@
   END
   v9.CheckSourceFailure(lines, 'E1383: Method "Foo": type mismatch, expected func(string, number): list<number> but got func(number, string): list<string>', 9)
 
-  # Use an abstract class to invoke an abstract method
-  # FIXME: This should fail
-  lines =<< trim END
-    vim9script
-    abstract class A
-      abstract static def Foo()
-    endclass
-    A.Foo()
-  END
-  v9.CheckSourceSuccess(lines)
-
   # Invoke an abstract method from a def function
   lines =<< trim END
     vim9script
@@ -5645,6 +5628,18 @@
     Bar(b)
   END
   v9.CheckSourceSuccess(lines)
+
+  # Use a static method in an abstract class
+  lines =<< trim END
+    vim9script
+    abstract class A
+      static def Foo(): string
+        return 'foo'
+      enddef
+    endclass
+    assert_equal('foo', A.Foo())
+  END
+  v9.CheckSourceSuccess(lines)
 enddef
 
 " Test for calling a class method from a subclass