mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Previously, this was treated as a regular CHECKCAST, causing KT-22410. #Fixed KT-22410 Target versions 1.2.30
20 lines
317 B
Kotlin
Vendored
20 lines
317 B
Kotlin
Vendored
fun box(): String {
|
|
defineFunc<String>()
|
|
|
|
func(1)
|
|
|
|
return if (testedEquals) "OK" else "Fail"
|
|
}
|
|
|
|
var func: (Any) -> Unit = {}
|
|
|
|
var testedEquals = false
|
|
|
|
inline fun <reified T> defineFunc() {
|
|
func = {
|
|
val nullable = it as? T
|
|
|
|
if (nullable == null)
|
|
testedEquals = true
|
|
}
|
|
} |