"Jonathan M Davis" wrote in message
news:zbkvnbibbmcfwhjvm...@forum.dlang.org...
> IMO the correct solution is for the compiler to insert preconditions at
> the calling site, rather than the callee.
If we had that, I'd actually start using in blocks. As it is, I think that
they're useless except when inheritance is involved, and they're more
verbose than just putting the assertions at the top of the function, so I
don't bother with the in block.
What do you think about
https://github.com/D-Programming-Language/dmd/pull/3799 ?
Basically, turn obviously invalid failing function calls into compile-time
errors. IMO this pushes in-contracts well out of the useless area.
- Re: assume, assert, enforce, @safe Sean Kelly via Digitalmars-d
- Re: assume, assert, enforce, @safe Dicebot via Digitalmars-d
- Re: assume, assert, enforce, @safe Daniel Murphy via Digitalmars-d
- Re: assume, assert, enforce, @... Sean Kelly via Digitalmars-d
- Re: assume, assert, enforce, @... Walter Bright via Digitalmars-d
- Re: assume, assert, enforce, @... H. S. Teoh via Digitalmars-d
- Re: assume, assert, enforce, @... Jonathan M Davis via Digitalmars-d
- Re: assume, assert, enforce, @... Timon Gehr via Digitalmars-d
- Re: assume, assert, enforce, @... Daniel Murphy via Digitalmars-d
- Re: assume, assert, enforce, @... bearophile via Digitalmars-d
- Re: assume, assert, enforce, @... Daniel Murphy via Digitalmars-d
- Re: assume, assert, enforce, @... bearophile via Digitalmars-d
- Re: assume, assert, enforce, @... bearophile via Digitalmars-d
- Re: assume, assert, enforce, @... Daniel Murphy via Digitalmars-d
- Re: assume, assert, enforce, @... bearophile via Digitalmars-d
- Re: assume, assert, enforce, @... H. S. Teoh via Digitalmars-d
- Re: assume, assert, enforce, @... Timon Gehr via Digitalmars-d
- Re: assume, assert, enforce, @... H. S. Teoh via Digitalmars-d
- Re: assume, assert, enforce, @... Timon Gehr via Digitalmars-d