mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 15:54:05 +00:00
13 lines
317 B
Kotlin
Vendored
13 lines
317 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.internal.contracts.*
|
|
|
|
fun Any?.isNotNull(): Boolean {
|
|
contract {
|
|
returns(true) implies (this@isNotNull != null)
|
|
}
|
|
return this != null
|
|
} |