Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/contracts/contractFromOtherModule_samePackage.kt
T
Dmitriy Novozhilov 4c96495eef [FIR] Put new contract syntax under feauture flag
^KT-55171 Fixed
2023-01-31 07:53:09 +00:00

26 lines
515 B
Kotlin
Vendored

// LANGUAGE: +ContractSyntaxV2
// SKIP_JAVAC
// This directive is needed to skip this test in LazyBodyIsNotTouchedTilContractsPhaseTestGenerated,
// because it fails to parse module structure of multimodule test
// WITH_STDLIB
// MODULE: lib
package main
import kotlin.contracts.*
fun requireIsTrue(value: Boolean) contract [
returns() implies value
] {
if (!value) throw IllegalArgumentException()
}
// MODULE: main(lib)
package main
fun test(s: Any) {
requireIsTrue(s is String)
s.length
}