DIP 1009--Improve Contract Usability--Preliminary Review Round 1

MysticZach via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 26 23:11:18 PDT 2017


On Monday, 26 June 2017 at 21:06:10 UTC, Timon Gehr wrote:
> The DIP is missing the corresponding syntax for invariants:
>
> class C{
>     private int x=1;
>     invariant(x>0, "x must stay positive");
> }
>
> Implementation:
> https://github.com/dlang/dmd/compare/master...tgehr:contract-syntax

Well done. It seems to speak to the intuitive nature of the 
design that it's so easy to deduce how it would work in this 
context.


More information about the Digitalmars-d mailing list