"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.

Reply via email to