Files
kotlin-fork/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt1778.kt
T
Svetlana Isakova cd5521d6dc rename error
2012-09-07 19:03:07 +04:00

11 lines
407 B
Kotlin
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//KT-1778 Automatically cast error
package kt1778
fun main(args : Array<String>) {
val x = args[0]: Any
if(x is <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.CharSequence<!>) {
if ("a" == x) x.length() else x.length() // OK
if ("a" == x || "b" == x) x.length() else x.length() // < THEN ERROR
if ("a" == x && "a" == x) x.length() else x.length() // < ELSE ERROR
}
}