Extract Function: Consider member property with invoke() a receiver candidate

#KT-9774 Fixed
This commit is contained in:
Alexey Sedunov
2015-11-26 21:21:48 +03:00
parent 03e1480476
commit 6abf13be41
6 changed files with 47 additions and 3 deletions
@@ -0,0 +1,7 @@
// PARAM_DESCRIPTOR: public final class A defined in root package
// PARAM_TYPES: A
// SIBLING:
class A {
val foo: () -> String = { "OK" }
fun bar() = <selection>foo.invoke()</selection>
}
@@ -0,0 +1,9 @@
// PARAM_DESCRIPTOR: public final class A defined in root package
// PARAM_TYPES: A
// SIBLING:
class A {
val foo: () -> String = { "OK" }
fun bar() = s()
}
private fun A.s() = foo.invoke()
@@ -0,0 +1,7 @@
// PARAM_DESCRIPTOR: public final class A defined in root package
// PARAM_TYPES: A
// SIBLING:
class A {
val foo: () -> String = { "OK" }
fun bar() = <selection>foo()</selection>
}
@@ -0,0 +1,9 @@
// PARAM_DESCRIPTOR: public final class A defined in root package
// PARAM_TYPES: A
// SIBLING:
class A {
val foo: () -> String = { "OK" }
fun bar() = s()
}
private fun A.s() = foo()