patch 9.0.1926: Vim9: not enough info in error message
Problem: Vim9: not enough info in error message
Solution: Add class name, change member to variable, quote names
closes: #13136
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim
index f57bf44..6c33816 100644
--- a/src/testdir/test_vim9_class.vim
+++ b/src/testdir/test_vim9_class.vim
@@ -646,7 +646,7 @@
Test_assign_to_nested_typed_member()
END
- v9.CheckSourceFailure(lines, 'E46: Cannot change read-only variable "value"')
+ v9.CheckSourceFailure(lines, 'E1335: Variable "value" in class "Inner" is not writable')
# Assignment where target item is read only script level
lines =<< trim END
@@ -669,7 +669,7 @@
script_outer.inner.value = 1
assert_equal(1, script_inner.value)
END
- v9.CheckSourceFailure(lines, 'E1335: Member is not writable: value')
+ v9.CheckSourceFailure(lines, 'E1335: Variable "value" in class "Inner" is not writable')
enddef
def Test_assignment_with_operator()
@@ -1243,7 +1243,7 @@
var b = B.new()
b.Foo()
END
- v9.CheckSourceFailure(lines, 'E46: Cannot change read-only variable "ro_class_var"')
+ v9.CheckSourceFailure(lines, 'E1335: Variable "ro_class_var" in class "A" is not writable')
# A private class variable cannot be accessed from a child class
lines =<< trim END
@@ -4269,7 +4269,7 @@
enddef
T()
END
- v9.CheckSourceFailure(lines, 'E46: Cannot change read-only variable "val"')
+ v9.CheckSourceFailure(lines, 'E1335: Variable "val" in class "A" is not writable')
enddef
" Test for reading and writing a class member from a def function
@@ -5541,7 +5541,7 @@
var d = D.new()
T(d)
END
- v9.CheckSourceFailure(lines, 'E46: Cannot change read-only variable "value"')
+ v9.CheckSourceFailure(lines, 'E1335: Variable "value" in class "A" is not writable')
enddef
" Test for calling methods using a null object