mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
22 lines
332 B
Kotlin
Vendored
22 lines
332 B
Kotlin
Vendored
open class T(var value: Int) {}
|
|
|
|
fun localExtensionOnNullableParameter(): T {
|
|
|
|
fun T.local(s: Int) {
|
|
value += s
|
|
}
|
|
|
|
var t: T? = T(1)
|
|
t?.local(2)
|
|
|
|
return t!!
|
|
}
|
|
|
|
|
|
fun box(): String {
|
|
val result = localExtensionOnNullableParameter().value
|
|
if (result != 3) return "fail 2: $result"
|
|
|
|
return "OK"
|
|
}
|