mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
20 lines
399 B
Kotlin
Vendored
20 lines
399 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.internal.contracts.*
|
|
|
|
fun foo(x: Any?): Boolean {
|
|
contract {
|
|
returns() implies (x is String)
|
|
}
|
|
return bar(x)
|
|
}
|
|
|
|
fun bar(x: Any?): Boolean {
|
|
contract {
|
|
returns() implies (x is Int)
|
|
}
|
|
return foo(x)
|
|
} |