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:
@@ -0,0 +1,11 @@
|
||||
// Anonymous object's initialization does not affect smart casts
|
||||
|
||||
abstract class A(val s: String) {
|
||||
fun bar(): String = s
|
||||
}
|
||||
|
||||
fun foo(o: String?): Int {
|
||||
val a = object : A(o!!){}
|
||||
a.bar()
|
||||
return <!DEBUG_INFO_SMARTCAST!>o<!>.length()
|
||||
}
|
||||
Reference in New Issue
Block a user