|
1 |
| -*vim9class.txt* For Vim version 9.1. Last change: 2025 Jul 24 |
| 1 | +*vim9class.txt* For Vim version 9.1. Last change: 2025 Aug 27 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -282,7 +282,7 @@ name.
|
282 | 282 |
|
283 | 283 | 3. Class Variables and Methods *Vim9-class-member*
|
284 | 284 |
|
285 |
| - *:static* *E1337* *E1338* *E1368* |
| 285 | + *:static* *E1329* *E1337* *E1338* *E1368* |
286 | 286 | Class members are declared with "static". They are used by the name without a
|
287 | 287 | prefix in the class where they are defined: >
|
288 | 288 |
|
@@ -515,12 +515,18 @@ prefix when defining the method: >
|
515 | 515 | <
|
516 | 516 | A static method in an abstract class cannot be an abstract method.
|
517 | 517 |
|
| 518 | + *E1404* |
| 519 | +An interface method cannot be an abstract method. |
| 520 | + |
518 | 521 | *E1373*
|
519 | 522 | A non-abstract class extending the abstract class must implement all the
|
520 | 523 | abstract methods. The signature (arguments, argument types and return type)
|
521 | 524 | must be exactly the same. If the return type of a method is a class, then
|
522 | 525 | that class or one of its subclasses can be used in the extended method.
|
523 | 526 |
|
| 527 | + *E1431* |
| 528 | +An abstract method in an abstract super class cannot be invoked. |
| 529 | + |
524 | 530 | ==============================================================================
|
525 | 531 |
|
526 | 532 | 5. Using an interface *Vim9-using-interface*
|
@@ -637,6 +643,7 @@ object variable name used in a super class cannot be reused in a child class.
|
637 | 643 |
|
638 | 644 | Object Variable Initialization ~
|
639 | 645 |
|
| 646 | + *E1430* |
640 | 647 | If the type of a variable is not explicitly specified in a class, then it is
|
641 | 648 | set to "any" during class definition. When an object is instantiated from the
|
642 | 649 | class, then the type of the variable is set.
|
@@ -959,10 +966,10 @@ An enum is a type that can have one of a list of values. Example: >
|
959 | 966 | Green, Blue, Black
|
960 | 967 | endenum
|
961 | 968 | <
|
962 |
| - *enumvalue* *E1422* |
| 969 | + *enumvalue* *E1422* *E1428* |
963 | 970 | The enum values are separated by commas. More than one enum value can be
|
964 | 971 | listed in a single line. The final enum value should not be followed by a
|
965 |
| -comma. |
| 972 | +comma. Duplicate enum values are not allowed. |
966 | 973 |
|
967 | 974 | An enum value is accessed using the enum name followed by the value name: >
|
968 | 975 |
|
@@ -1021,7 +1028,7 @@ The following example shows an enum with object variables and methods: >
|
1021 | 1028 | Enums and their values are immutable. They cannot be utilized as numerical or
|
1022 | 1029 | string types. Enum values can declare mutable instance variables.
|
1023 | 1030 |
|
1024 |
| - *enum-name* |
| 1031 | + *enum-name* *E1427* |
1025 | 1032 | Each enum value object has a "name" instance variable which contains the name
|
1026 | 1033 | of the enum value. This is a readonly variable.
|
1027 | 1034 |
|
|
0 commit comments