Replace explicit parameter with it: don't suggest if overload resolution ambiguity error occurs

#KT-20795 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-05-07 12:42:18 +09:00
committed by Yan Zhulanow
parent 69a2697598
commit 5b927d798c
8 changed files with 81 additions and 6 deletions
@@ -0,0 +1,5 @@
fun foo() {
val a: (Int) -> Unit = { <caret>a -> bar(a) }
}
fun bar(i: Int) {}
@@ -0,0 +1,5 @@
fun foo() {
val a: (Int) -> Unit = { bar(it) }
}
fun bar(i: Int) {}
@@ -0,0 +1,7 @@
fun test() {
C().foo { <caret>i -> i + 1 }
}
class C {
fun foo(f: (Int) -> Int) {}
}
@@ -0,0 +1,7 @@
fun test() {
C().foo { it + 1 }
}
class C {
fun foo(f: (Int) -> Int) {}
}
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun test() {
foo { <caret>i -> i + 1 }
}
fun foo(f: (Int) -> Int) {}
fun foo(f: (Int, Int) -> Int) {}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: false
fun test() {
C().foo { <caret>i -> i + 1 }
}
class C {
fun foo(f: (Int) -> Int) {}
fun foo(f: (Int, Int) -> Int) {}
}