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:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user