diff src/testdir/test_vim9_class.vim @ 31758:85f93e094810 v9.0.1211

patch 9.0.1211: storing value in interface member does not always work Commit: https://github.com/vim/vim/commit/f7d1c6e1884c76680980571f1cf15e0928d247b5 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 16 20:47:57 2023 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Jan 2023 22:00:03 +0100
parents 48431422f766
children 8d2bfc85e3c5
line wrap: on
line diff
--- a/src/testdir/test_vim9_class.vim
+++ b/src/testdir/test_vim9_class.vim
@@ -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()