KT-10706: do not report IMPLICIT_CAST_TO_ANY on expressions of type Nothing

This commit is contained in:
Dmitry Petrov
2016-01-18 18:42:24 +03:00
parent 5889ba4293
commit 0c52960d7a
4 changed files with 24 additions and 1 deletions
@@ -0,0 +1,12 @@
fun TODO(): Nothing = null!!
fun fn(c: Char?): Any? =
if (c == null) TODO()
else when (<!DEBUG_INFO_SMARTCAST!>c<!>) {
'a' -> when (<!DEBUG_INFO_SMARTCAST!>c<!>) {
'B' -> <!IMPLICIT_CAST_TO_ANY!>1<!>
'C' -> <!IMPLICIT_CAST_TO_ANY!>"sdf"<!>
else -> TODO()
}
else -> TODO()
}
@@ -0,0 +1,4 @@
package
public fun TODO(): kotlin.Nothing
public fun fn(/*0*/ c: kotlin.Char?): kotlin.Any?