Join Slack
Powered by
``` fun Any?.foo(other: Any?) { contract { ...
# announcements
l
LeoColman
03/22/2019, 1:17 AM
Copy code
fun Any?.foo(other: Any?) { contract { other == null implies (this != null) } }
d
Dico
03/22/2019, 4:47 AM
In what situation does this make sense? This moves the responsibility for the contract to the caller.
Dico
03/22/2019, 4:47 AM
The function implementing a contract is responsible for meeting it.
Dico
03/22/2019, 4:50 AM
The function can say something about the parameters in the way it returns, not in the values that are passed to it.
2
Views
Open in Slack
Previous
Next