mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
21 lines
403 B
Kotlin
Vendored
21 lines
403 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.internal.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)
|
|
}
|
|
}
|