Data flow values for Elvis / parenthesized expressions, smart casts on them

This commit is contained in:
Mikhail Glukhikh
2015-12-08 16:50:04 +03:00
parent 745a3aeeac
commit d024045638
10 changed files with 160 additions and 16 deletions
+15
View File
@@ -0,0 +1,15 @@
fun foo(s: String) = s.length
fun baz(s: String?, r: String?): Int {
return foo(r <info descr="Smart cast to kotlin.String">?:</info> when {
s != null -> s
else -> ""
})
}
fun bar(s: String?, r: String?): Int {
return (r <info descr="Smart cast to kotlin.String">?:</info> when {
s != null -> s
else -> ""
}).length
}