Create from Usage: Infer expected type for lambda body
#KT-18186 Fixed
This commit is contained in:
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// "Create function 'bar'" "true"
|
||||
|
||||
class A<T>(val t: T)
|
||||
|
||||
fun <T, U> A<T>.convert(f: (T) -> U) = A(f(t))
|
||||
|
||||
fun foo(l: A<String>): A<Int> {
|
||||
return l.convert(fun(it: String): Int { return <caret>bar(it) })
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Create function 'bar'" "true"
|
||||
|
||||
class A<T>(val t: T)
|
||||
|
||||
fun <T, U> A<T>.convert(f: (T) -> U) = A(f(t))
|
||||
|
||||
fun foo(l: A<String>): A<Int> {
|
||||
return l.convert(fun(it: String): Int { return bar(it) })
|
||||
}
|
||||
|
||||
fun bar(it: String): Int {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// "Create function 'bar'" "true"
|
||||
|
||||
class A<T>(val t: T)
|
||||
|
||||
fun <T, U> A<T>.convert(f: (T) -> U) = A(f(t))
|
||||
|
||||
fun foo(l: A<String>): A<Int> {
|
||||
return l.convert(fun(it: String) = <caret>bar(it))
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Create function 'bar'" "true"
|
||||
|
||||
class A<T>(val t: T)
|
||||
|
||||
fun <T, U> A<T>.convert(f: (T) -> U) = A(f(t))
|
||||
|
||||
fun foo(l: A<String>): A<Int> {
|
||||
return l.convert(fun(it: String) = bar(it))
|
||||
}
|
||||
|
||||
fun bar(it: String): Int {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create function 'bar'" "true"
|
||||
|
||||
class A<T>(val t: T)
|
||||
|
||||
fun <T, U> A<T>.convert(f: (T) -> U) = A(f(t))
|
||||
|
||||
fun foo(l: A<String>): A<Int> {
|
||||
return l.convert { <caret>bar(it) }
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// "Create function 'bar'" "true"
|
||||
|
||||
class A<T>(val t: T)
|
||||
|
||||
fun <T, U> A<T>.convert(f: (T) -> U) = A(f(t))
|
||||
|
||||
fun foo(l: A<String>): A<Int> {
|
||||
return l.convert { bar(it) }
|
||||
}
|
||||
|
||||
fun bar(it: String): Int {
|
||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
Reference in New Issue
Block a user