Allow declaring contracts on suspend functions. KT-27468 Fixed
This commit is contained in:
+3
-3
@@ -24,7 +24,7 @@ open class Class {
|
||||
}
|
||||
|
||||
suspend fun suspendMember(x: Boolean) {
|
||||
<!CONTRACT_NOT_ALLOWED, CONTRACT_NOT_ALLOWED!>contract<!> { returns() implies (x) }
|
||||
<!CONTRACT_NOT_ALLOWED!>contract<!> { returns() implies (x) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ inline fun inlineTopLevel(x: Boolean) {
|
||||
}
|
||||
|
||||
suspend fun suspendTopLevel(x: Boolean) {
|
||||
<!CONTRACT_NOT_ALLOWED!>contract<!> { returns() implies (x) }
|
||||
contract { returns() implies (x) }
|
||||
}
|
||||
|
||||
// Top-level operator
|
||||
@@ -73,7 +73,7 @@ fun test() {
|
||||
}
|
||||
|
||||
suspend fun suspendlocalDeclaration(x: Boolean) {
|
||||
<!CONTRACT_NOT_ALLOWED, CONTRACT_NOT_ALLOWED!>contract<!> { returns() implies (x) }
|
||||
<!CONTRACT_NOT_ALLOWED!>contract<!> { returns() implies (x) }
|
||||
}
|
||||
|
||||
val localAnonymousFunction = fun (x: Boolean) {
|
||||
+2
@@ -7,6 +7,8 @@ public inline fun inlineTopLevel(/*0*/ x: kotlin.Boolean): kotlin.Unit
|
||||
Returns(WILDCARD) -> x
|
||||
|
||||
public suspend fun suspendTopLevel(/*0*/ x: kotlin.Boolean): kotlin.Unit
|
||||
Returns(WILDCARD) -> x
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public fun topLevel(/*0*/ x: kotlin.Boolean): kotlin.Unit
|
||||
Returns(WILDCARD) -> x
|
||||
Reference in New Issue
Block a user