http://forum.dlang.org/post/jftnpqyahnwacgkms...@forum.dlang.org

c:\D\import\dfl\button.d(381): Error: function
dfl.button.Button.text cannot have
e an in contract when overriden function dfl.control.Control.text
does not have an in contract

This is the line 381:

override void text(Dstring txt) // setter
in
{
        if(txt.length)
                assert(!this.image, "Button image with text not supported");
}
body
{
        super.text = txt;
}

But if a button can't display image with text by design, it's its contract, that text can't be set with image, while the base class has no such restriction. What does it mean, DbC is incompatible with inheritance?

Reply via email to