0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 9.0.1211: storing value in interface member does not always work

Problem:    Storing value in interface member does not always work.
Solution:   Convert the index on the interface to the index on the object.
This commit is contained in:
Bram Moolenaar
2023-01-16 20:47:57 +00:00
parent b391e1f805
commit f7d1c6e188
6 changed files with 44 additions and 8 deletions

View File

@@ -876,14 +876,14 @@ def Test_class_implements_interface()
vim9script
interface Result
this.label: string
public this.label: string
this.errpos: number
endinterface
# order of members is opposite of interface
class Failure implements Result
this.errpos: number = 42
this.label: string = 'label'
public this.label: string = 'label'
endclass
def Test()
@@ -891,6 +891,10 @@ def Test_class_implements_interface()
assert_equal('label', result.label)
assert_equal(42, result.errpos)
result.label = 'different'
assert_equal('different', result.label)
assert_equal(42, result.errpos)
enddef
Test()