diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-09-27 19:02:01 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-09-27 19:02:01 +0200 |
commit | 2dede3dbfa3cb52f464f942d46d3ec0f66e3e354 (patch) | |
tree | 95218eeb382aa0e51be357af311157279a53b1bd /runtime | |
parent | 5277cfaf8afe847b7d4dcde6057fbecb001ab64e (diff) |
patch 9.0.1945: Vim9: missing support for ro-vars in interfacev9.0.1945
Problem: Vim9: missing support for ro-vars in interface
Solution: Support only read-only object variables in an interface,
add additional checks when parsing class definitions.
closes: #13183
cloess: #13184
cloess: #13185.
closes: #13188
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/tags | 3 | ||||
-rw-r--r-- | runtime/doc/vim9class.txt | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/runtime/doc/tags b/runtime/doc/tags index daf59a90d9..918e767721 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4479,6 +4479,9 @@ E1380 vim9class.txt /*E1380* E1381 vim9class.txt /*E1381* E1382 vim9class.txt /*E1382* E1383 vim9class.txt /*E1383* +E1387 vim9class.txt /*E1387* +E1388 vim9class.txt /*E1388* +E1389 vim9class.txt /*E1389* E139 message.txt /*E139* E140 message.txt /*E140* E1400 builtin.txt /*E1400* diff --git a/runtime/doc/vim9class.txt b/runtime/doc/vim9class.txt index a27f7319a7..b230cb8007 100644 --- a/runtime/doc/vim9class.txt +++ b/runtime/doc/vim9class.txt @@ -464,10 +464,10 @@ The interface name can be used as a type: > echo $'the surface is {shape.Surface()}' endfor < - *E1378* *E1379* *E1380* -An interface can have only instance variables (read-only and read-write -access) and methods. An interface cannot contain private variables, private -methods, class variables and class methods. + *E1378* *E1379* *E1380* *E1387* +An interface can contain only object methods and read-only object variables. +An interface cannot contain read-write and private object variables, private +object methods, class variables and class methods. An interface can extend another interface using "extends". The sub-interface inherits all the instance variables and methods from the super interface. @@ -563,7 +563,7 @@ will be added automatically. A class implementing an interface ~ - *implements* *E1346* *E1347* + *implements* *E1346* *E1347* *E1389* A class can implement one or more interfaces. The "implements" keyword can only appear once *E1350* . Multiple interfaces can be specified, separated by commas. Each interface name can appear only once. *E1351* @@ -577,7 +577,7 @@ interface, which is often done in many languages, especially Java. Items in a class ~ - *E1318* *E1325* + *E1318* *E1325* *E1388* Inside a class, in between `:class` and `:endclass`, these items can appear: - An object variable declaration: > this._privateVariableName: memberType |