We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
withLock
Would it be possible to add contracts for function like withLock that call their block only once?
public actual inline fun <T> ReentrantLock.withLock(block: () -> T): T { // Add this contract { callsInPlace(block, kind = InvocationKind.EXACTLY_ONCE) } lock() try { return block() } finally { unlock() } }
This will help the compiler do better type inference and I think contracts are safe to use in libs?
The text was updated successfully, but these errors were encountered:
mvicsokolova
No branches or pull requests
Would it be possible to add contracts for function like
withLock
that call their block only once?This will help the compiler do better type inference and I think contracts are safe to use in libs?
The text was updated successfully, but these errors were encountered: