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:
Mikhail Glukhikh
2015-04-16 17:07:00 +03:00
parent d5aed62410
commit e97e792674
18 changed files with 172 additions and 115 deletions
@@ -0,0 +1,9 @@
public fun foo(x: String?): Int {
do {
// After the check, smart cast should work
x ?: x!!.length()
// x is not null in both branches
if (<!DEBUG_INFO_SMARTCAST!>x<!>.length() == 0) break
} while (true)
return <!DEBUG_INFO_SMARTCAST!>x<!>.length()
}