Files
kotlin/idea/testData/quickfix/replaceWithSafeCallForScopeFunction/letWithWrongParam.kt
2018-02-28 10:31:27 +03:00

14 lines
444 B
Kotlin
Vendored

// "Replace scope function with safe (?.) call" "false"
// WITH_RUNTIME
// ACTION: Add non-null asserted (!!) call
// ACTION: Introduce local variable
// ACTION: Replace with safe (?.) call
// ACTION: Surround with null check
// ACTION: Add return@let
// ERROR: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
fun foo(a: String?, b: String?) {
a.let { s ->
b<caret>.length
}
}