Inliner: specify explicit lambda signature for calls with lambdas
So #KT-17213 Fixed So #KT-17395 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class Declaration {
|
||||
fun lambdaType(p: Int, f: (Int) -> Int) = f(p)
|
||||
}
|
||||
|
||||
fun call(declaration: Declaration) {
|
||||
declaration.<caret>lambdaType(6) { it + 7 }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Declaration {
|
||||
}
|
||||
|
||||
fun call(declaration: Declaration) {
|
||||
({ it: Int -> it + 7 })(6)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Declaration {
|
||||
fun lambdaType(p: Int, f: (Int) -> Int) = f(p)
|
||||
}
|
||||
|
||||
fun call(declaration: Declaration) {
|
||||
declaration.<caret>lambdaType(8) { x -> x + 9 }}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Declaration {
|
||||
}
|
||||
|
||||
fun call(declaration: Declaration) {
|
||||
({ x: Int -> x + 9 })(8)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Declaration {
|
||||
fun lambdaType(p: Int, f: (Int) -> Int) = f(p)
|
||||
}
|
||||
|
||||
fun call(declaration: Declaration) {
|
||||
declaration.<caret>lambdaType(10) { _ -> 11 }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Declaration {
|
||||
}
|
||||
|
||||
fun call(declaration: Declaration) {
|
||||
({ _: Int -> 11 })(10)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun <T, U> operateLambda(p: T, f: (T) -> U) = f(p)
|
||||
fun returnLabel() {
|
||||
<caret>operateLambda(1) {}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun returnLabel() {
|
||||
({ it: Int -> })(1)
|
||||
}
|
||||
Reference in New Issue
Block a user