Fix nullability propagation in inline class type mapping
#KT-27096 See https://jetbrains.slack.com/archives/C06E082M6/p1537949572000100
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
inline class Ucn(private val i: UInt)
|
||||
|
||||
class PPInput(private val s: ByteArray) {
|
||||
fun peek(n: UInt = 0u): Ucn? =
|
||||
if (n >= s.size.toUInt())
|
||||
null
|
||||
else
|
||||
Ucn(s[n.toInt()].toUInt())
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val ppInput = PPInput(byteArrayOf(0.toByte(), 0.toByte(), 0.toByte()))
|
||||
|
||||
if (ppInput.peek(0u) == null) throw AssertionError()
|
||||
if (ppInput.peek(100u) != null) throw AssertionError()
|
||||
if (ppInput.peek(0u)!!.toString() != "Ucn(i=0)") throw AssertionError(ppInput.peek(0u)!!.toString())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user