Files
kotlin/compiler/testData/codegen/bytecodeText/inlineClasses/asCastForInlineClass.kt
Mikhail Zarechenskiy 6d4d244c28 Generate function from Any for inline classes same as for data classes
#KT-24873 Fixed
 #KT-25293 Fixed
 #KT-25299 Fixed
2018-08-06 10:56:01 +03:00

22 lines
421 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// FILE: utils.kt
inline class UInt(val u: Int)
// FILE: test.kt
fun test(a1: Any, a2: UInt?, a3: Any?, a4: Any?) {
val b1 = a1 as UInt // checkcast, unbox
val b2 = a2 as UInt // unbox
val b3 = a3 as UInt? // checkcast
val b4 = a4 as? UInt // instanceof, checkcast
}
// @TestKt.class:
// 3 CHECKCAST UInt
// 2 INVOKEVIRTUAL UInt.unbox
// 1 INSTANCEOF UInt
// 0 intValue