Adjust testData to CharSequence.length transformation
This commit is contained in:
committed by
Mikhail Glukhikh
parent
cb562e7ea5
commit
f0e3fd617d
@@ -1,6 +1,6 @@
|
||||
fun calc(x: List<String>?): Int {
|
||||
// x should be non-null in arguments list, including inner call
|
||||
x?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size - 1).length())
|
||||
x?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size - 1).length)
|
||||
// but not also here!
|
||||
return x<!UNSAFE_CALL!>.<!>size
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ fun String.foo(arg: Int) = this[arg]
|
||||
|
||||
fun calc(x: String?) {
|
||||
// x should be non-null in arguments list
|
||||
x?.foo(<!DEBUG_INFO_SMARTCAST!>x<!>.length() - 1)
|
||||
x?.foo(<!DEBUG_INFO_SMARTCAST!>x<!>.length - 1)
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ fun String.bar(s: String) = s
|
||||
|
||||
fun foo(s: String?) {
|
||||
s?.bar(<!DEBUG_INFO_SMARTCAST!>s<!>)
|
||||
s?.get(<!DEBUG_INFO_SMARTCAST!>s<!>.length())
|
||||
s?.get(<!DEBUG_INFO_SMARTCAST!>s<!>.length)
|
||||
}
|
||||
@@ -2,7 +2,7 @@ fun foo(x: String): String? = x
|
||||
|
||||
fun calc(x: String?, y: String?): Int {
|
||||
// Smart cast because of y!! in receiver
|
||||
x?.subSequence(y!!.subSequence(0, 1).length(), <!DEBUG_INFO_SMARTCAST!>y<!>.length())
|
||||
x?.subSequence(y!!.subSequence(0, 1).length, <!DEBUG_INFO_SMARTCAST!>y<!>.length)
|
||||
// No smart cast possible
|
||||
return y<!UNSAFE_CALL!>.<!>length()
|
||||
return y<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ fun foo(y: Int): Int {
|
||||
|
||||
fun calc(x: List<String>?): Int {
|
||||
// x should be non-null in arguments list
|
||||
return foo(x?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size - 1)!!.length())
|
||||
return foo(x?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size - 1)!!.length)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
data class MyClass(val x: String?)
|
||||
|
||||
fun foo(y: MyClass): Int {
|
||||
val z = y.x?.subSequence(0, <!DEBUG_INFO_SMARTCAST!>y.x<!>.length())
|
||||
return z?.length() ?: -1
|
||||
val z = y.x?.subSequence(0, <!DEBUG_INFO_SMARTCAST!>y.x<!>.length)
|
||||
return z?.length ?: -1
|
||||
}
|
||||
@@ -2,7 +2,7 @@ fun foo(x: String): String? = x
|
||||
|
||||
fun calc(x: String?): Int {
|
||||
// Smart cast because of x!! in receiver
|
||||
foo(x!!)?.subSequence(0, <!DEBUG_INFO_SMARTCAST!>x<!>.length())
|
||||
foo(x!!)?.subSequence(0, <!DEBUG_INFO_SMARTCAST!>x<!>.length)
|
||||
// Smart cast because of x!! in receiver
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.length()
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ fun foo(x: String): String? = x
|
||||
|
||||
fun calc(x: String?): Int {
|
||||
// Smart cast because of x!! in receiver
|
||||
foo(x!!)?.subSequence(0, <!DEBUG_INFO_SMARTCAST!>x<!>.length())?.length()
|
||||
foo(x!!)?.subSequence(0, <!DEBUG_INFO_SMARTCAST!>x<!>.length)?.length
|
||||
// Smart cast because of x!! in receiver
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.length()
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ fun foo(x: String): String? = x
|
||||
|
||||
fun calc(x: String?, y: Int?): Int {
|
||||
// Smart cast because of x!! in receiver
|
||||
foo(x!!)?.subSequence(y!!, <!DEBUG_INFO_SMARTCAST!>x<!>.length())?.length()
|
||||
foo(x!!)?.subSequence(y!!, <!DEBUG_INFO_SMARTCAST!>x<!>.length)?.length
|
||||
// No smart cast possible
|
||||
return <!TYPE_MISMATCH!>y<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user