Data flow information is no longer dropped while analyzing object literal expression. #KT-6293 Fixed. #KT-7110 Fixed.

A set of tests for KT-6293 / KT-7110 provided.
This commit is contained in:
Mikhail Glukhikh
2015-05-19 12:00:20 +03:00
parent 5bca1d3c8f
commit c8aa6defb6
19 changed files with 328 additions and 10 deletions
@@ -0,0 +1,21 @@
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
}