Files
kotlin-fork/idea/testData/inspectionsLocal/branched/ifThenToSafeAccess/thenAndElseNotNull.kt
T
2017-12-26 18:39:47 +03:00

12 lines
280 B
Kotlin
Vendored

// PROBLEM: none
// ERROR: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
fun main(args: Array<String>) {
val foo: String? = "foo"
if (foo == null<caret>) {
foo.length
}
else {
foo.length
}
}