ee8702d21e
See changes in e2606b72bdbec2fea567d4127197707869eb801e
22 lines
455 B
Kotlin
Vendored
22 lines
455 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
// !USE_EXPERIMENTAL: 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)
|
|
}
|
|
}
|