mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
21 lines
347 B
Kotlin
Vendored
21 lines
347 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
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
|
|
}
|
|
} |