KT-7068 None of the following functions can be called with two functions with extention function parameter

#KT-7068 Fixed
This commit is contained in:
Svetlana Isakova
2015-03-26 11:33:35 +01:00
parent ca98b19aba
commit 61d0bcdf76
7 changed files with 108 additions and 25 deletions
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun withLambda(block : Int.(String) -> Unit) {
}
fun withLambda(o : Int, block : Int.(String) -> Unit) {
}
fun test() {
withLambda {
it.length()
}
withLambda { r -> // no error should be here
r.length()
}
}
@@ -0,0 +1,5 @@
package
internal fun test(): kotlin.Unit
internal fun withLambda(/*0*/ o: kotlin.Int, /*1*/ block: kotlin.Int.(kotlin.String) -> kotlin.Unit): kotlin.Unit
internal fun withLambda(/*0*/ block: kotlin.Int.(kotlin.String) -> kotlin.Unit): kotlin.Unit
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun withLambda(block : Int.(String) -> Unit) {
}
fun withLambda(block : Int.(String, String) -> Unit) {
}
fun test() {
withLambda { r ->
r.length()
}
withLambda { x, y ->
x.length() + y.length()
}
}
@@ -0,0 +1,5 @@
package
internal fun test(): kotlin.Unit
internal fun withLambda(/*0*/ block: kotlin.Int.(kotlin.String) -> kotlin.Unit): kotlin.Unit
internal fun withLambda(/*0*/ block: kotlin.Int.(kotlin.String, kotlin.String) -> kotlin.Unit): kotlin.Unit