Skip to content

Repeated calls to class setter triggers assertion #3423

Closed
@suwc

Description

@suwc
class B {
    set x(v) { print("B.prototype.set x"); this._x = v; }
    get x() { print("B.prototype.get x"); return this._x; }
}

class A extends B {
    set x(v) { print("A.prototype.set x"); super.x = v + 100; }
    get x() { print("A.prototype.get x"); return super.x; }
}

var a = new A();
a.x = 100;
print(a.x);

var a1 = new A();
a1.x = 100;
print(a1.x);

Expected:

A.prototype.set x
B.prototype.set x
A.prototype.get x
B.prototype.get x
200
A.prototype.set x
B.prototype.set x
A.prototype.get x
B.prototype.get x
200

Actual

A.prototype.set x
B.prototype.set x
A.prototype.get x
B.prototype.get x
200
A.prototype.set x
ASSERTION 15068: (lib\runtime\Language/InlineCache.inl, line 356) setterValue == nullptr || setterValue == function
 Failure: (setterValue == nullptr || setterValue == function)
FATAL ERROR: ch.exe failed due to exception code c0000420

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions