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

15 lines
500 B
Kotlin
Vendored

// "Replace scope function with safe (?.) call" "false"
// WITH_RUNTIME
// ACTION: Add non-null asserted (!!) call
// ACTION: Introduce local variable
// ACTION: Move lambda argument into parentheses
// ACTION: Replace with safe (this?.) call
// ACTION: Specify explicit lambda signature
// ACTION: Add return@let
// ERROR: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
fun String?.foo(a: String?) {
a.let { s ->
<caret>length
}
}