[FIR-TEST] Add new testdata generated after changes in previous commit
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
fun test(a: Any?) {
|
||||
if (a == null) return
|
||||
a.hashCode()
|
||||
|
||||
val b = a
|
||||
b.hashCode()
|
||||
|
||||
val c: Any? = a
|
||||
c.hashCode()
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// KT-6118 Redundant type cast can be not redundant?
|
||||
|
||||
fun foo(o: Any) {
|
||||
if (o is String) {
|
||||
val s = o as String
|
||||
s.length
|
||||
}
|
||||
}
|
||||
|
||||
fun foo1(o: Any) {
|
||||
if (o is String) {
|
||||
o.length
|
||||
val s = o
|
||||
s.length
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
fun test(a: Any?, flag: Boolean, x: Any?) {
|
||||
if (a !is String) return
|
||||
a.length
|
||||
|
||||
val b: Any?
|
||||
|
||||
if (flag) {
|
||||
b = a
|
||||
b.length
|
||||
}
|
||||
else {
|
||||
b = x
|
||||
b.<!UNRESOLVED_REFERENCE!>length<!>()
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
fun test(a: Any?, flag: Boolean, x: Any?) {
|
||||
if (a == null) return
|
||||
a.hashCode()
|
||||
|
||||
val b: Any?
|
||||
|
||||
if (flag) {
|
||||
b = a
|
||||
b.hashCode()
|
||||
}
|
||||
else {
|
||||
b = x
|
||||
b.hashCode()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fun test(a: Any?) {
|
||||
when (a) {
|
||||
is String -> {
|
||||
val s = a
|
||||
s.length
|
||||
}
|
||||
"" -> {
|
||||
val s = a
|
||||
s.hashCode()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user