Adjust various testData to size transformation
This commit is contained in:
@@ -2,5 +2,5 @@ fun calc(x: List<String>?, y: Int?): Int {
|
||||
x?.get(y!! - 1)
|
||||
// y!! above should not provide smart cast here
|
||||
val yy: Int = <!TYPE_MISMATCH!>y<!>
|
||||
return yy + (x?.size() ?: 0)
|
||||
return yy + (x?.size ?: 0)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun calc(x: List<String>?): Int {
|
||||
// After KT-5840 fix !! assertion should become unnecessary here
|
||||
x?.get(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.size() - 1)
|
||||
x?.get(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.size - 1)
|
||||
// x?. or x!! above should not provide smart cast here
|
||||
return x<!UNSAFE_CALL!>.<!>size()
|
||||
return x<!UNSAFE_CALL!>.<!>size
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun calc(x: List<String>?): Int {
|
||||
// x should be non-null in arguments list, despite of a chain
|
||||
x?.subList(0, 1)?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size())
|
||||
x?.subList(0, 1)?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size)
|
||||
// But not here!
|
||||
return x!!.size()
|
||||
return x!!.size
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun calc(x: List<String>?, y: List<Int>?) {
|
||||
// x and y should be non-null in arguments list, despite of a chains
|
||||
x?.subList(y?.subList(1, 2)?.get(<!DEBUG_INFO_SMARTCAST!>y<!>.size()) ?: 0,
|
||||
x?.subList(y?.subList(1, 2)?.get(<!DEBUG_INFO_SMARTCAST!>y<!>.size) ?: 0,
|
||||
y?.get(0) ?: 1) // But safe call is NECESSARY here for y
|
||||
?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size())
|
||||
?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size)
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
fun calc(x: List<String>?): Int {
|
||||
// x should be non-null in arguments list, despite of a chain
|
||||
x?.subList(0, 1)<!UNSAFE_CALL!>.<!>get(<!DEBUG_INFO_SMARTCAST!>x<!>.size())
|
||||
x?.subList(0, 1)<!UNSAFE_CALL!>.<!>get(<!DEBUG_INFO_SMARTCAST!>x<!>.size)
|
||||
// But not here!
|
||||
return x!!.size()
|
||||
return x!!.size
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
return x<!UNSAFE_CALL!>.<!>size
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
fun foo(y: Int) = y
|
||||
|
||||
fun calc(x: List<String>?): Int {
|
||||
foo(x!!.size())
|
||||
foo(x!!.size)
|
||||
// Here we should have smart cast because of x!!, despite of KT-7204 fixed
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.size()
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.size
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
fun String.foo(y: Int) = y
|
||||
|
||||
fun calc(x: List<String>?): Int {
|
||||
"abc".foo(x!!.size())
|
||||
"abc".foo(x!!.size)
|
||||
// Here we should have smart cast because of x!!, despite of KT-7204 fixed
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.size()
|
||||
return <!DEBUG_INFO_SMARTCAST!>x<!>.size
|
||||
}
|
||||
|
||||
@@ -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 @@
|
||||
fun calc(x: List<String>?) {
|
||||
// x should be non-null in arguments list, despite of a chain
|
||||
x?.subList(0, <!DEBUG_INFO_SMARTCAST!>x<!>.size())?.
|
||||
subList(0, <!DEBUG_INFO_SMARTCAST!>x<!>.size())?.
|
||||
get(<!DEBUG_INFO_SMARTCAST!>x<!>.size())
|
||||
x?.subList(0, <!DEBUG_INFO_SMARTCAST!>x<!>.size)?.
|
||||
subList(0, <!DEBUG_INFO_SMARTCAST!>x<!>.size)?.
|
||||
get(<!DEBUG_INFO_SMARTCAST!>x<!>.size)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun calc(x: List<String>?): Int {
|
||||
// x should be non-null in arguments list
|
||||
x?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size() - 1)
|
||||
x?.get(<!DEBUG_INFO_SMARTCAST!>x<!>.size - 1)
|
||||
// but not also here!
|
||||
return x<!UNSAFE_CALL!>.<!>size()
|
||||
return x<!UNSAFE_CALL!>.<!>size
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun calc(x: List<String>?): Int {
|
||||
// x should be non-null in arguments list
|
||||
x?.subList(<!DEBUG_INFO_SMARTCAST!>x<!>.size() - 1, <!DEBUG_INFO_SMARTCAST!>x<!>.size())
|
||||
x?.subList(<!DEBUG_INFO_SMARTCAST!>x<!>.size - 1, <!DEBUG_INFO_SMARTCAST!>x<!>.size)
|
||||
// but not also here!
|
||||
return x<!UNSAFE_CALL!>.<!>size()
|
||||
return x<!UNSAFE_CALL!>.<!>size
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user