On Friday, 23 September 2016 at 07:54:15 UTC, John C wrote:
If I try to call the protected method of a superclass from
inside the body of a delegate, the compiler won't allow it.
void layoutTransaction(Control c, void delegate() action) {
// do stuff
action();
// do more stuff
}
class Control {
protected void onTextChanged() {}
}
class Label : Control {
protected override void onTextChanged() {
layoutTransaction(this, {
super.onTextChanged(); // <--- Error here
changeSize();
});
}
private void changeSize() {}
}
Output: class Control member onTextChanged is not accessible.
How is it possible that "onTextChanged" isn't accessible but
the private method "changeSize" *is*?
Please file a bug report issues.dlang.org, shouldn't be difficult
to fix.