CAST_NEVER_SUCCEEDS: do not report when casting nullable to nullable #KT-260 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-08-09 16:41:30 +03:00
parent 2b44335c27
commit 098520de64
4 changed files with 22 additions and 2 deletions
@@ -0,0 +1,7 @@
// From KT-13324: always succeeds
val x = null <!USELESS_CAST!>as String?<!>
// From KT-260: sometimes succeeds
fun foo(a: String?): Int? {
val c = a as? Int?
return c
}
@@ -0,0 +1,4 @@
package
public val x: kotlin.String? = null
public fun foo(/*0*/ a: kotlin.String?): kotlin.Int?