Unnecessary parentheses in function call with lambda: fix false positive #KT-26669 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-10-31 15:50:00 +09:00
committed by Mikhail Glukhikh
parent 2d0ecf8f50
commit 1df15612d6
5 changed files with 46 additions and 3 deletions
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun Unit.returnFun3(fn: (Unit) -> Unit): ((Unit) -> Unit) -> Unit = {}
fun test() {
Unit.returnFun3 {} ()<caret> {}
}
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun <T> T.returnFun5(fn: (T) -> Boolean): ((T) -> T) -> Unit = {}
fun test() {
25.returnFun5 { true } ()<caret> { it * 2 }
}
@@ -0,0 +1,13 @@
// IS_APPLICABLE: false
object A {
object B {
class C {
fun returnFun(fn: () -> Unit): (() -> Unit) -> Unit = {}
}
}
}
fun test() {
A.B.C().returnFun {} ()<caret> {}
}