mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
13 lines
340 B
Kotlin
Vendored
13 lines
340 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.internal.contracts.*
|
|
|
|
fun foo(n: Int, x: Any?): Boolean {
|
|
contract {
|
|
returns(true) implies (x is String)
|
|
}
|
|
return if (n == 0) x is String else foo(n - 1, x)
|
|
} |