Berry instance variables are never methods

This commit is contained in:
Stephan Hadinger 2022-02-15 17:35:09 +01:00
parent a34de6e67e
commit 5f64dc38e0
1 changed files with 5 additions and 1 deletions

View File

@ -904,7 +904,11 @@ newframe: /* a new call frame */
if (var_isinstance(a) && var_isstr(b)) {
binstance *obj = var_toobj(a);
bstring *attr = var_tostr(b);
if (!be_instance_setmember(vm, obj, attr, c)) {
bvalue result = *c;
if (var_isfunction(&result)) {
var_markstatic(&result);
}
if (!be_instance_setmember(vm, obj, attr, &result)) {
reg = vm->reg;
vm_error(vm, "attribute_error",
"class '%s' cannot assign to attribute '%s'",