Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclTwoArgument.kt
T
2015-05-21 13:03:39 +03:00

22 lines
430 B
Kotlin
Vendored

abstract class Runnable(val arg: Int) {
abstract fun run(): Int
}
interface Wrapper {
fun run(): Int
}
fun foo(): Int {
val c: Int? = null
val a: Int? = 1
if (c is Int) {
val k = object: Wrapper, Runnable(a!!) {
override fun run() = arg
}
k.run()
val d: Int = <!DEBUG_INFO_SMARTCAST!>c<!>
return <!DEBUG_INFO_SMARTCAST!>a<!> + d
}
else return -1
}