KT-10005 Java to Kotlin: do not convert type cast to cast to nullable if it should not be null

#KT-10005 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-11-20 15:58:49 +03:00
parent d78390e489
commit f98b354bc1
5 changed files with 38 additions and 2 deletions
@@ -0,0 +1,6 @@
public class A {
void foo(Object o) {
if (o == null) return;
int length = ((String) o).length();
}
}
@@ -0,0 +1,6 @@
class A {
internal fun foo(o: Any?) {
if (o == null) return
val length = (o as String).length
}
}