Convert lambda to reference: add type parameter to outer call expression if needed
#KT-37744 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
a4239afcb3
commit
69a2697598
+8
@@ -0,0 +1,8 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
fun overloadFun(p: String, q: Long) {}
|
||||
|
||||
fun <T, U> foo(fn: (T, U) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo {<caret> x: String, y: Long -> overloadFun(x, y) }
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
fun overloadFun(p: String, q: Long) {}
|
||||
|
||||
fun <T, U> foo(fn: (T, U) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo<String, Long>(::overloadFun)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
fun overloadFun(p: String, q: Long) {}
|
||||
|
||||
fun <T, U> foo(fn: (T, U) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo({<caret> x: String, y: Long -> overloadFun(x, y) })
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
fun overloadFun(p: String, q: Long) {}
|
||||
|
||||
fun <T, U> foo(fn: (T, U) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo<String, Long>(::overloadFun)
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
fun overloadFun(p: String, q: Long) {}
|
||||
|
||||
fun interface Action<T, U> {
|
||||
fun bar(t: T, u: U)
|
||||
}
|
||||
|
||||
fun <T, U> foo(a: Action<T, U>) {}
|
||||
|
||||
fun test() {
|
||||
foo {<caret> x: String, y: Long -> overloadFun(x, y) }
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
fun overloadFun(p: String, q: Long) {}
|
||||
|
||||
fun interface Action<T, U> {
|
||||
fun bar(t: T, u: U)
|
||||
}
|
||||
|
||||
fun <T, U> foo(a: Action<T, U>) {}
|
||||
|
||||
fun test() {
|
||||
foo<String, Long>(::overloadFun)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
|
||||
fun <T, U> foo(fn: (T, U) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo {<caret> x: Int, y: Long -> overloadFun(x, y) }
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
|
||||
fun <T, U> foo(fn: (T, U) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo(::overloadFun)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
fun overloadFun(p: Int) {}
|
||||
|
||||
fun <T, U> foo(fn: (T, U) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo {<caret> x: Int, y: Long -> overloadFun(x, y) }
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
fun overloadFun(p: Int, q: Long) {}
|
||||
fun overloadFun(p: Int) {}
|
||||
|
||||
fun <T, U> foo(fn: (T, U) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
foo(::overloadFun)
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun overloadFun(p: Int) {}
|
||||
fun overloadFun(p: String) {}
|
||||
|
||||
fun <T> ambiguityFun(vararg fn: (T) -> Unit) {}
|
||||
|
||||
fun overloadContext() {
|
||||
ambiguityFun({<caret> x: String -> overloadFun(x) }, ::overloadFun)
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
fun overloadFun(p: Int) {}
|
||||
fun overloadFun(p: String) {}
|
||||
|
||||
fun <T> ambiguityFun(vararg fn: (T) -> Unit) {}
|
||||
|
||||
fun overloadContext() {
|
||||
ambiguityFun<String>(::overloadFun, ::overloadFun)
|
||||
}
|
||||
Reference in New Issue
Block a user