Review fixes for smart casts in / out loops.
LoopTypeInfo became TypeInfoWithJumpInfo rewritten in Kotlin. Fixed a bug with break inside Elvis inside a loop, a pack of related tests added. isTrueConstant moved to JetPsiUtil.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
public fun foo(x: String?, y: String?): Int {
|
||||
while (true) {
|
||||
(if (x != null) break else y) ?: y!!
|
||||
// x is not null in both branches
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length()
|
||||
}
|
||||
// y can be null because of the break
|
||||
return y<!UNSAFE_CALL!>.<!>length()
|
||||
}
|
||||
Reference in New Issue
Block a user