Replace explicit parameter with it: don't suggest if overload resolution ambiguity error occurs
#KT-20795 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
69a2697598
commit
5b927d798c
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
val a: (Int) -> Unit = { <caret>a -> bar(a) }
|
||||
}
|
||||
|
||||
fun bar(i: Int) {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
val a: (Int) -> Unit = { bar(it) }
|
||||
}
|
||||
|
||||
fun bar(i: Int) {}
|
||||
idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_qualifiedExpression.kt
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
fun test() {
|
||||
C().foo { <caret>i -> i + 1 }
|
||||
}
|
||||
|
||||
class C {
|
||||
fun foo(f: (Int) -> Int) {}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun test() {
|
||||
C().foo { it + 1 }
|
||||
}
|
||||
|
||||
class C {
|
||||
fun foo(f: (Int) -> Int) {}
|
||||
}
|
||||
+7
@@ -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) {}
|
||||
+9
@@ -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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user