Join Slack
Powered by
I was looking at Kotlin source. I found code ...
# announcements
l
Les
01/20/2018, 11:41 AM
I was looking at Kotlin source. I found code
contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }
Where does
contract
come from? What does this code do?
k
kingsley
01/20/2018, 11:47 AM
I remember
@yole
mention that this is a feature currently been played with, that’s supposed to define a set of contracts a function will adhere to. However, it’s only visible in the src, but doesn’t do anything at the moment
j
Joshua F
01/20/2018, 11:48 AM
https://github.com/JetBrains/kotlin/blob/edd3f76e7ba3578e1328009ac2f4d56ff9ecec95/libraries/stdlib/src/kotlin/internal/contracts/ContractBuilder.kt#L40-L43
Joshua F
01/20/2018, 11:48 AM
That should answer where it comes from
👍 1
Open in Slack
Previous
Next