Files
kotlin-fork/js/js.translator/testData/box/expression/cast/castExtensionToKProperty1.kt
T
Alexey Andreev 3b3fd0fa0d JS: fix DCE limits in test data to fit new kotlin.js size
The size has increased due to new implementation of KClass
2017-10-06 18:16:51 +03:00

18 lines
401 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1120
package foo
import kotlin.reflect.KProperty1
class A
val A.x: Int
get() = 23
fun box(): String {
assertEquals(true, (A::x as Any) is KProperty1<*, *>)
assertEquals(23, ((A::x as Any) as KProperty1<A, Any>)(A()))
assertEquals(false, (23 as Any) is KProperty1<*, *>)
assertEquals(false, ({ A().x } as Any) is KProperty1<*, *>)
return "OK"
}