Convert parameter <-> receiver intention: do not add label to 'this' if not needed

#KT-17615 Fixed
#KT-30028 Fixed
#KT-32809 Fixed
#KT-28085 Fixed
#KT-37508 Fixed

Convert receiver to parameter:

#KT-37508 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-03-19 16:01:00 +09:00
committed by Ilya Kirillov
parent 34e9e899f8
commit c344b85d4e
15 changed files with 157 additions and 2 deletions
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun <caret>Int.add() {
run { println(this + 1) }
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun add(i: Int) {
i.run { println(this + 1) }
}
@@ -0,0 +1,11 @@
interface A
fun <caret>A.foo() {}
fun test() {
object : A {
fun bar() {
foo()
}
}
}
@@ -0,0 +1,11 @@
interface A
fun foo(a: A) {}
fun test() {
object : A {
fun bar() {
foo(this)
}
}
}