Effects: add test on (de)serialization of contracts
- Add ContractDescriptorRenderer - Add option to dump function contracts in DescriptorRendererOptions - Add parsing of LANGUAGE_VERSION directive in AbstractLoadJava - Add tests on serialization-deserializaton identity of contracts ========== Introduction of EffectSystem: 13/18
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
@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)
|
||||
}
|
||||
Reference in New Issue
Block a user