Ignore sources which are not LOADs in refinedIntTypeAnalysis

#KT-33414 Fixed
This commit is contained in:
Ilmir Usmanov
2019-08-21 19:39:01 +03:00
parent 4697822b5a
commit f9506db20a
7 changed files with 67 additions and 17 deletions
@@ -0,0 +1,34 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// FULL_JDK
import java.nio.ByteBuffer
class Test {
suspend fun discardSuspend(discarded0: Long, max: Long) {
while (isClosedForRead) {
// this assignment is required
val rc = reading {
true
}
if (!readSuspend(1)) break
}
}
private inline fun reading(block: () -> Boolean): Boolean {
setupStateForRead() ?: return false
try {
return block()
} finally {
}
}
val isClosedForRead = false
private suspend fun readSuspend(size: Int): Boolean = true
private fun setupStateForRead(): Any? = null
}
fun box() = "OK"