Files
kotlin-fork/idea/testData/intentions/branched/ifThenToDoubleBang/ifAsExpression.kt
T
2014-04-22 22:33:08 +04:00

15 lines
237 B
Kotlin

// WITH_RUNTIME
fun maybeFoo(): String? {
return "foo"
}
fun main(args: Array<String>) {
val foo = maybeFoo()
val x = if (foo == null<caret>) {
throw KotlinNullPointerException()
}
else {
foo
}
}