Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/inference/smartCastOnReceiver.kt
T
2014-10-01 18:52:52 +04:00

13 lines
286 B
Kotlin

trait A
trait B
class Test {
fun test(a: A?, b: B, list: MutableList<Pair<A, B>>) {
if (a != null) {
list.add(<!DEBUG_INFO_SMARTCAST!>a<!> to b)
}
}
}
class Pair<out A, out B>(val first: A, val second: B)
fun <A, B> A.to(that: B) = Pair(this, that)