c7435ba760
We are going to deprecate `WITH_RUNTIME` directive. The main reason behind this change is that `WITH_STDLIB` directive better describes its meaning, specifically it will add kotlin stdlib to test's classpath.
16 lines
474 B
Kotlin
Vendored
16 lines
474 B
Kotlin
Vendored
// WITH_STDLIB
|
|
package common
|
|
|
|
fun test(x: List<Int>?) {
|
|
// If the function returns false, the value is definitely not null:
|
|
if (!x.isNullOrEmpty()) {
|
|
println(x.size) // Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type List<Int>?
|
|
}
|
|
}
|
|
|
|
fun test(x: Any?) {
|
|
// If the function returns (does not throw), then the argument is true:
|
|
require(x is String)
|
|
println(x.length) // Unresolved reference: length
|
|
}
|