Java to Kotlin converter: better treatment of nullable expressions
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
class C() {
|
||||
fun getString(b: Boolean): String? {
|
||||
return if (b)
|
||||
"a"
|
||||
else
|
||||
null
|
||||
}
|
||||
|
||||
fun foo(): Int {
|
||||
return getString(true)?.length()!!
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user