Java to Kotlin converter: more smartness about nullability
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
trait I {
|
||||
public fun getString(): String
|
||||
}
|
||||
|
||||
class C() {
|
||||
fun foo(i: I, b: Boolean) {
|
||||
val result = i.getString()
|
||||
if (b)
|
||||
result = null
|
||||
if (result != null) {
|
||||
print(result)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user