22 lines
445 B
Kotlin
Vendored
22 lines
445 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
// !OPT_IN: kotlin.contracts.ExperimentalContracts
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.contracts.*
|
|
|
|
class A
|
|
|
|
fun simpleIsInstace(x: Any?) {
|
|
contract {
|
|
returns(true) implies (x is A)
|
|
}
|
|
}
|
|
|
|
fun Any?.receiverIsInstance() {
|
|
contract {
|
|
returns(true) implies (this@receiverIsInstance is A)
|
|
}
|
|
}
|