Fixed KT-2072: do not suggest to use type inference in Introduce Variable in case if expression type depends on expected type.
This commit is contained in:
@@ -3,7 +3,7 @@ fun foo(c : Collection<String>){
|
||||
}
|
||||
/*
|
||||
fun foo(c : Collection<String>){
|
||||
val function: () -> Boolean = {it; false}
|
||||
val function = {it; false}
|
||||
c.filter(function)
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,17 @@
|
||||
class A {
|
||||
fun foo() = 1
|
||||
}
|
||||
fun apply(x: (A) -> Int) = 2
|
||||
fun test() {
|
||||
apply<selection>{it.foo()}</selection>
|
||||
}
|
||||
/*
|
||||
class A {
|
||||
fun foo() = 1
|
||||
}
|
||||
fun apply(x: (A) -> Int) = 2
|
||||
fun test() {
|
||||
val function: (A) -> Int = {it.foo()}
|
||||
apply(function)
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user