Files
kotlin-fork/j2k/testData/fileOrElement/nullability/nullableField.kt
T
2016-03-11 12:08:10 +03:00

42 lines
646 B
Kotlin
Vendored

package test
import java.util.ArrayList
class Test {
private var myProp: String? = null
private var myIntProp: Int? = null
fun onCreate() {
myProp = ""
myIntProp = 1
}
fun test() {
foo1(myProp!!)
foo2(myProp!!)
foo3(myProp)
myProp!![myIntProp!!]
println(myProp)
val b = "aaa" == myProp
val s = "aaa" + myProp!!
myProp!!.compareTo(myProp!!, ignoreCase = true)
val list = ArrayList<Int>()
list.remove(myIntProp!!)
}
fun foo1(s: String) {
}
fun foo2(s: String) {
}
fun foo3(s: String?) {
}
}