Anonymous function to lambda: add lambda parameter if type parameter is used, even if parameter is unused
#KT-39393 Fixed
This commit is contained in:
committed by
igoriakovlev
parent
311b2d7969
commit
e4a1c8dcef
+6
@@ -0,0 +1,6 @@
|
||||
fun <T> foo(fn: (T) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo(<caret>fun(x: String) {
|
||||
})
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun <T> foo(fn: (T) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo { x: String -> }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun <T> foo(fn: (String) -> T) {}
|
||||
|
||||
fun test() {
|
||||
foo(<caret>fun(x: String) {
|
||||
})
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun <T> foo(fn: (String) -> T) {}
|
||||
|
||||
fun test() {
|
||||
foo { }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun foo(p: String) {}
|
||||
|
||||
fun <T> bar(vararg fn: (T) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
bar(<caret>fun(x: String) {
|
||||
foo(x)
|
||||
})
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun foo(p: String) {}
|
||||
|
||||
fun <T> bar(vararg fn: (T) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
bar({ x: String -> foo(x) })
|
||||
}
|
||||
Reference in New Issue
Block a user