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,10 @@
|
||||
public fun foo(x: String?): Int {
|
||||
do {
|
||||
// After the check, smart cast should work
|
||||
x ?: break
|
||||
// x is not null in both branches
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length()
|
||||
} while (true)
|
||||
// x is null because of the break
|
||||
return x<!UNSAFE_CALL!>.<!>length()
|
||||
}
|
||||
Reference in New Issue
Block a user