Remove single lambda parameter declaration: fix false positive on property with implicit type #KT-23134

This commit is contained in:
Toshiaki Kameyama
2018-11-13 10:45:48 +09:00
committed by Mikhail Glukhikh
parent 793cac02e8
commit cbaa8e5be2
5 changed files with 42 additions and 5 deletions
@@ -0,0 +1,8 @@
// "Remove single lambda parameter declaration" "true"
fun test() {
val f: (Int) -> Unit = { <caret>i: Int -> foo() }
bar(f)
}
fun foo() {}
fun bar(f: (Int) -> Unit) {}
@@ -0,0 +1,8 @@
// "Remove single lambda parameter declaration" "true"
fun test() {
val f: (Int) -> Unit = { foo() }
bar(f)
}
fun foo() {}
fun bar(f: (Int) -> Unit) {}
@@ -0,0 +1,10 @@
// "Remove single lambda parameter declaration" "false"
// ACTION: Remove explicit lambda parameter types (may break code)
// ACTION: Rename to _
fun test() {
val f = { <caret>i: Int -> foo() }
bar(f)
}
fun foo() {}
fun bar(f: (Int) -> Unit) {}