Adjust testData to CharSequence.length transformation
This commit is contained in:
committed by
Mikhail Glukhikh
parent
cb562e7ea5
commit
f0e3fd617d
@@ -2,9 +2,9 @@ fun foo() {
|
||||
var v: Any = 42
|
||||
v.<!UNRESOLVED_REFERENCE!>length<!>()
|
||||
v = "abc"
|
||||
<!DEBUG_INFO_SMARTCAST!>v<!>.length()
|
||||
<!DEBUG_INFO_SMARTCAST!>v<!>.length
|
||||
v = 42
|
||||
v.<!UNRESOLVED_REFERENCE!>length<!>()
|
||||
v = "abc"
|
||||
<!DEBUG_INFO_SMARTCAST!>v<!>.length()
|
||||
<!DEBUG_INFO_SMARTCAST!>v<!>.length
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ fun x(): Boolean { return true }
|
||||
public fun foo(pp: Any): Int {
|
||||
var p = pp
|
||||
do {
|
||||
(p as String).length()
|
||||
(p as String).length
|
||||
if (p == "abc") break
|
||||
p = 42
|
||||
} while (!x())
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ public fun foo(xx: Any): Int {
|
||||
y = "abc"
|
||||
}
|
||||
// y!! in both branches
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length()
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length
|
||||
} while (!(x is String))
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.length()
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
}
|
||||
Vendored
+1
-1
@@ -9,7 +9,7 @@ public fun foo(xx: Any): Int {
|
||||
y = "abc"
|
||||
}
|
||||
// y!! in both branches
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length()
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length
|
||||
} while (true)
|
||||
// We could have smart cast here but with break it's hard to detect
|
||||
return x.<!UNRESOLVED_REFERENCE!>length<!>()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
public fun bar(s: String) {
|
||||
System.out.println("Length of $s is ${s.length()}")
|
||||
System.out.println("Length of $s is ${s.length}")
|
||||
}
|
||||
|
||||
public fun foo() {
|
||||
|
||||
@@ -6,7 +6,7 @@ fun get(): Any {
|
||||
fun foo(): Int {
|
||||
var ss: Any = get()
|
||||
|
||||
return if (ss is String && <!DEBUG_INFO_SMARTCAST!>ss<!>.length() > 0)
|
||||
return if (ss is String && <!DEBUG_INFO_SMARTCAST!>ss<!>.length > 0)
|
||||
1
|
||||
else
|
||||
0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
public fun bar(s: String) {
|
||||
System.out.println("Length of $s is ${s.length()}")
|
||||
System.out.println("Length of $s is ${s.length}")
|
||||
}
|
||||
|
||||
public fun foo() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class MyClass(var p: String?)
|
||||
|
||||
fun bar(s: String): Int {
|
||||
return s.length()
|
||||
return s.length
|
||||
}
|
||||
|
||||
fun foo(m: MyClass): Int {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
class MyClass(var p: String?)
|
||||
|
||||
fun bar(s: String?): Int {
|
||||
return s?.length() ?: -1
|
||||
return s?.length ?: -1
|
||||
}
|
||||
|
||||
fun foo(m: MyClass): Int {
|
||||
|
||||
@@ -4,6 +4,6 @@ fun get(): Any {
|
||||
|
||||
fun foo(): Int {
|
||||
var c: Any = get()
|
||||
(c as String).length()
|
||||
return <!DEBUG_INFO_SMARTCAST!>c<!>.length() // Previous line should make as unnecessary here.
|
||||
(c as String).length
|
||||
return <!DEBUG_INFO_SMARTCAST!>c<!>.length // Previous line should make as unnecessary here.
|
||||
}
|
||||
@@ -3,7 +3,7 @@ fun x(): Boolean { return true }
|
||||
public fun foo(pp: Any): Int {
|
||||
var p = pp
|
||||
while(true) {
|
||||
(p as String).length()
|
||||
(p as String).length
|
||||
if (x()) break
|
||||
p = 42
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ fun list(start: String) {
|
||||
if (e==null) return
|
||||
while (e is String) {
|
||||
// Smart cast due to the loop condition
|
||||
if (<!DEBUG_INFO_SMARTCAST!>e<!>.length() == 0)
|
||||
if (<!DEBUG_INFO_SMARTCAST!>e<!>.length == 0)
|
||||
break
|
||||
// We still have smart cast here despite of a break
|
||||
e = <!DEBUG_INFO_SMARTCAST!>e<!>.next()
|
||||
|
||||
Reference in New Issue
Block a user