Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.kt
T
2015-09-25 19:20:20 +03:00

19 lines
387 B
Kotlin
Vendored

// !CHECK_TYPE
interface A
interface B : A
operator fun B.compareTo(b: B) = if (this == b) 0 else 1
fun foo(a: A): Boolean {
val result = (a as B) < <!DEBUG_INFO_SMARTCAST!>a<!>
checkSubtype<B>(<!DEBUG_INFO_SMARTCAST!>a<!>)
return result
}
fun bar(a: A, b: B): Boolean {
val result = b < (a as B)
checkSubtype<B>(<!DEBUG_INFO_SMARTCAST!>a<!>)
return result
}