"Convert reference to lambda" intention: handle extension function reference with extension function call

#KT-35558 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-12-19 19:53:51 +09:00
committed by igoriakovlev
parent 9ff7539ff0
commit b1e8238ea2
8 changed files with 81 additions and 4 deletions
@@ -0,0 +1,9 @@
fun func(a: Int) {
}
fun Int.foo(block: (Int) -> Unit) {
}
fun main() {
42.foo(::func<caret>)
}
@@ -0,0 +1,9 @@
fun func(a: Int) {
}
fun Int.foo(block: (Int) -> Unit) {
}
fun main() {
42.foo { func(it) }
}
@@ -0,0 +1,9 @@
fun func(a: Int) {
}
fun Int.foo(block: Int.() -> Unit) {
}
fun main() {
42.foo(::func<caret>)
}
@@ -0,0 +1,9 @@
fun func(a: Int) {
}
fun Int.foo(block: Int.() -> Unit) {
}
fun main() {
42.foo { func(this) }
}
@@ -0,0 +1,9 @@
fun func2(a: Int, b: Int) {
}
fun Int.foo(block: Int.(Int) -> Unit) {
}
fun main() {
42.foo(::func2<caret>)
}
@@ -0,0 +1,9 @@
fun func2(a: Int, b: Int) {
}
fun Int.foo(block: Int.(Int) -> Unit) {
}
fun main() {
42.foo { b -> func2(this, b) }
}