INIT(= N_("E1333: Cannot access private member: %s"));
// E1334 unused
EXTERN char e_member_is_not_writable_str[]
- INIT(= N_("E1335: Member is not writable: %s"));
+ INIT(= N_("E1335: Variable \"%s\" in class \"%s\" is not writable"));
#endif
EXTERN char e_internal_error_shortmess_too_long[]
INIT(= "E1336: Internal error: shortmess too long");
if ((flags & GLV_READ_ONLY) == 0)
{
semsg(_(e_member_is_not_writable_str),
- om->ocm_name);
+ om->ocm_name, cl->class_name);
return NULL;
}
break;
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
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()
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
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
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
{
char *msg = (m->ocm_access == VIM_ACCESS_PRIVATE)
? e_cannot_access_private_member_str
- : e_cannot_change_readonly_variable_str;
- semsg(_(msg), m->ocm_name);
+ : e_member_is_not_writable_str;
+ semsg(_(msg), m->ocm_name, cl->class_name);
return FALSE;
}