[FIR-TEST] Add new testdata generated after changes in previous commit

This commit is contained in:
Dmitriy Novozhilov
2019-12-11 16:16:22 +03:00
parent e9c02a1cca
commit 2536fa0cd5
4578 changed files with 104067 additions and 1 deletions
@@ -0,0 +1,37 @@
// !WITH_NEW_INFERENCE
fun foo(s: Any?): String {
val t = when {
// To resolve: String U Nothing? = String?
s is String -> s
else -> null
} ?: ""
return t
}
fun bar(s: Any?): String {
// To resolve: String U Nothing? = String?
val t = (if (s == null) {
null
}
else {
val u: Any? = null
if (u !is String) return ""
u
}) ?: "xyz"
// Ideally we should have smart cast to String here
return t
}
fun baz(s: String?, r: String?): String {
val t = r ?: when {
s != null -> s
else -> ""
}
return t
}
fun withNull(s: String?): String {
val t = s ?: null
// Error: nullable
return t
}