Accurate representation of smart casts on complex expressions
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
fun baz(s: String?): Int {
|
||||
return <info descr="Smart cast to kotlin.String">if</info> (s == null) {
|
||||
""
|
||||
}
|
||||
else {
|
||||
val u: String? = null
|
||||
if (u == null) return 0
|
||||
u
|
||||
}.length
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun baz(s: String?): Int {
|
||||
if (s == null) return 0
|
||||
return <info descr="Smart cast to kotlin.String">when</info>(<info descr="Smart cast to kotlin.String">s</info>) {
|
||||
"abc" -> s
|
||||
else -> "xyz"
|
||||
}.length
|
||||
}
|
||||
Reference in New Issue
Block a user