set method
Sets a property of this value.
Implementation
@override
void set(String name, Object? value, [InterpreterVisitor? visitor]) {
// DFUB4: dispatch to a declared setter. The setter body runs with `this`
// bound to this instance and typically mutates the (mutable) representation
// object — the representation reference itself is final.
final setter = extensionType.setters[name];
if (setter != null && visitor != null) {
setter.bind(this).call(visitor, [value], {});
return;
}
throw RuntimeD4rtException(
"Extension type '${extensionType.name}' has no setter '$name'",
);
}