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:
committed by
Mikhail Glukhikh
parent
b53ebd115b
commit
f64345634b
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user