Open munificent opened 9 years ago
Oops - I seem to have a missed the field in the snippet and also didn't update sentence from a previous version of the draft (_$foo
was not defined anywhere).
I fixed in 80876f9 to say:
An intercepted field:
@interceptor var name;
is equivalent to:
var _$name; get name => interceptor.get(target, const _$nameMember()); set name(value) => interceptor.set(target, value, const _$nameMember());
A final field will not have the setter, and the
_$name
field will be final.
As of your question of making the backing state optional - it's a good idea, I'm open to it. I'll leave this bug open to keep track of that.
The proposal says:
But the example doesn't show a field at all. It might be nice if the interceptor can choose whether or not the intercepted field gets backing state or not.