mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
13 lines
311 B
Kotlin
Vendored
13 lines
311 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
|
|
|
package test
|
|
|
|
import kotlin.contracts.*
|
|
|
|
fun Any?.isNotNull(): Boolean {
|
|
contract {
|
|
returns(true) implies (this@isNotNull != null)
|
|
}
|
|
return this != null
|
|
} |