Strage class' with invariant() {} function behaviour

Jarrett Billingsley jarrett.billingsley at gmail.com
Wed Oct 8 12:43:01 PDT 2008


On Wed, Oct 8, 2008 at 3:31 PM, mumba <qniol at o2.pl> wrote:
> Jarrett Billingsley Wrote:
>
>>  My guess is that D is inserting an implicit
>> "out(result) { assert(this); }" on each public method, but the out
>> contract probably hasn't yet been updated and thinks typeof(result) is
>> just Object, not invariant(Object).  Hence, error.
>
> Sorry, but I don't understand this sentence :). What do you mean by "updated"? "assert(this) added"? I guess not, since this is what D is actually doing (beginning of the sentence) so how we can even expect having sth done before we did it? Is there some kind of "update" D performs in order to turn types to invariant(types)?
>

By updated I mean that there seem to be some areas in the D2 compiler
that still don't know about const and invariant.

assert(this) calls the invariant of 'this'.


More information about the Digitalmars-d-learn mailing list