Extraction Engine: Replace receiver occurrences with 'this' when necessary

This commit is contained in:
Alexey Sedunov
2015-09-14 13:16:20 +03:00
parent b80720209e
commit 767897dccf
6 changed files with 50 additions and 22 deletions
@@ -0,0 +1,11 @@
// PARAM_TYPES: kotlin.String, Comparable<String>, CharSequence, kotlin.Any
// PARAM_DESCRIPTOR: public fun kotlin.String.test(): kotlin.Unit defined in root package
fun String.foo(f: () -> Unit) {
f()
}
fun String.test() {
"sss".foo {
println(<selection>this@test</selection>)
}
}
@@ -0,0 +1,13 @@
// PARAM_TYPES: kotlin.String, Comparable<String>, CharSequence, kotlin.Any
// PARAM_DESCRIPTOR: public fun kotlin.String.test(): kotlin.Unit defined in root package
fun String.foo(f: () -> Unit) {
f()
}
fun String.test() {
"sss".foo {
println(s())
}
}
private fun String.s() = this