"Wrap with let": fix for nullable extension function call #KT-6364 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-04-20 10:41:38 +03:00
committed by Mikhail Glukhikh
parent 093842932f
commit b6564ed19a
6 changed files with 51 additions and 5 deletions
@@ -0,0 +1,6 @@
// "Wrap with '?.let { ... }' call" "true"
// WITH_RUNTIME
fun f(s: String, action: (String.() -> Unit)?) {
s.action<caret>()
}
@@ -0,0 +1,6 @@
// "Wrap with '?.let { ... }' call" "true"
// WITH_RUNTIME
fun f(s: String, action: (String.() -> Unit)?) {
action?.let { s.it() }
}
@@ -0,0 +1,10 @@
// "Wrap with '?.let { ... }' call" "true"
// WITH_RUNTIME
fun f(s: String, action: (String.() -> Unit)?) {
s.foo().bar().action<caret>()
}
fun String.foo() = ""
fun String.bar() = ""
@@ -0,0 +1,10 @@
// "Wrap with '?.let { ... }' call" "true"
// WITH_RUNTIME
fun f(s: String, action: (String.() -> Unit)?) {
action?.let { s.foo().bar().it() }
}
fun String.foo() = ""
fun String.bar() = ""