I think the new contract `blah implies returnsNotN...
# language-evolution
y
I think the new contract
blah implies returnsNotNull()
is completely unnecessary. One can always rewrite it as the contrapositive
returns(null) implies !blah
. Is adding it really necessary then? Maybe it should stay in, but be made non-expiremental and simply add the same flags that the contrapositive would add. In fact, the current restriction that only
returnsNotNull()
may show up on the RHS of
implies
is entirely pointless as well, and in fact rather confusing. It should also support
returns(null)
et all. The only one that wouldn't make sense is
implies returns()
since that contract cannot be trusted (exceptions can always happen), unless you take it to mean something related to the purity of the function (which would be kinda fun, actually).