Closed
Description
Kotlin 2.0 can see through inline fun
s now, but it does not infer calls-in-place.
One workaround for #360 would be to do
override fun readAtMostTo(sink: Buffer, byteCount: Long): Long {
val bytesRead: Int
UnsafeBufferOperations.writeToTail(sink, 1) { bytes, startIndexInclusive, endIndexExclusive ->
val read: Int = TODO()
bytesRead = read
read
}
return bytesRead.toLong()
}
except without the contract the compiler complains bytesRead
is not initialized at the return.