Wrap with let: fix it works correctly for invoking function type

#KT-39182 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-06-11 13:13:26 +09:00
committed by igoriakovlev
parent babdeacdaf
commit f6e70cfed8
6 changed files with 68 additions and 2 deletions
@@ -0,0 +1,10 @@
// "Wrap with '?.let { ... }' call" "true"
// WITH_RUNTIME
interface Foo {
val bar: ((Int) -> Unit)?
}
fun test(foo: Foo) {
foo.bar<caret>(1)
}
@@ -0,0 +1,10 @@
// "Wrap with '?.let { ... }' call" "true"
// WITH_RUNTIME
interface Foo {
val bar: ((Int) -> Unit)?
}
fun test(foo: Foo) {
foo.bar?.let { it(1) }
}
@@ -0,0 +1,10 @@
// "Wrap with '?.let { ... }' call" "true"
// WITH_RUNTIME
interface Foo {
val bar: ((Int) -> Unit)?
}
fun Foo.test() {
<caret>bar(1)
}
@@ -0,0 +1,10 @@
// "Wrap with '?.let { ... }' call" "true"
// WITH_RUNTIME
interface Foo {
val bar: ((Int) -> Unit)?
}
fun Foo.test() {
bar?.let { it(1) }
}