WHEN_ENUM_CAN_BE_NULL_IN_JAVA is no more reported after smart cast to not-null #KT-15201 Fixed

This commit is contained in:
mglukhikh
2017-01-23 18:42:37 +03:00
committed by Mikhail Glukhikh
parent b53ebd115b
commit f64345634b
4 changed files with 21 additions and 1 deletions
@@ -27,6 +27,15 @@ fun platformType() = when (<!WHEN_ENUM_CAN_BE_NULL_IN_JAVA!>J.foo()<!>) {
E.B -> 8
}
fun platformTypeSmartCast(): Int {
val e = J.foo()
if (e == null) return -1
return when (<!DEBUG_INFO_SMARTCAST!>e<!>) {
E.A -> 1
E.B -> 2
}
}
// FILE: J.java
@@ -2,6 +2,7 @@ package
public fun nullableNothing(): kotlin.Nothing?
public fun platformType(): kotlin.Int
public fun platformTypeSmartCast(): kotlin.Int
public fun test(/*0*/ e: E?): kotlin.Int
public fun withNull(/*0*/ e: E?): kotlin.Int?
public fun withNullableNothing(/*0*/ e: E?): kotlin.Int?