Support explicit this receiver (this.foo()) for RestrictSuspension function call.

This commit is contained in:
Stanislav Erokhin
2016-12-15 16:17:32 +03:00
parent 8e3fd0efc3
commit c5aeaae8e6
3 changed files with 45 additions and 16 deletions
@@ -14,22 +14,40 @@ fun test() {
member()
extension()
// todo
this.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>member<!>()
this.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>extension<!>()
this.member()
this.extension()
val foo = this
foo.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>member<!>()
foo.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>extension<!>()
// todo
this@l.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>member<!>()
this@l.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>extension<!>()
this@l.member()
this@l.extension()
with(1) {
// todo
this@l.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>member<!>()
this@l.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>extension<!>()
this@l.member()
this@l.extension()
}
}
}
suspend fun RestrictedController.l() {
member()
extension()
this.member()
this.extension()
val foo = this
foo.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>member<!>()
foo.<!ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL!>extension<!>()
this@l.member()
this@l.extension()
with(1) {
this@l.member()
this@l.extension()
}
}
@@ -3,6 +3,7 @@ package
public fun generate(/*0*/ f: suspend RestrictedController.() -> kotlin.Unit): kotlin.Unit
public fun test(): kotlin.Unit
public suspend fun RestrictedController.extension(): kotlin.Unit
public suspend fun RestrictedController.l(): kotlin.Unit
@kotlin.coroutines.RestrictSuspension public final class RestrictedController {
public constructor RestrictedController()