Adjust various testData to size transformation

This commit is contained in:
Denis Zharkov
2015-10-06 11:11:18 +03:00
parent a0e9754edc
commit c21d827326
42 changed files with 59 additions and 59 deletions
@@ -43,4 +43,4 @@ fun <T, C: MutableCollection<in T>> Array<T>.toCollection(result: C) : C {
}
val Collection<*>.size : Int
get() = size()
get() = size
+4 -4
View File
@@ -1,7 +1,7 @@
package collections
fun <T> testCollection(c: Collection<T>, t: T) {
c.size()
c.size
c.isEmpty()
c.contains(1)
val <!UNUSED_VARIABLE!>iterator<!>: Iterator<T> = c.iterator()
@@ -17,7 +17,7 @@ fun <T> testCollection(c: Collection<T>, t: T) {
}
fun <T> testMutableCollection(c: MutableCollection<T>, t: T) {
c.size()
c.size
c.isEmpty()
c.contains(1)
val <!UNUSED_VARIABLE!>iterator<!>: Iterator<T> = c.iterator()
@@ -59,7 +59,7 @@ fun <T> testMutableList(l: MutableList<T>, t: T) {
}
fun <T> testSet(s: Set<T>, t: T) {
s.size()
s.size
s.isEmpty()
s.contains(1)
val <!UNUSED_VARIABLE!>iterator<!>: Iterator<T> = s.iterator()
@@ -75,7 +75,7 @@ fun <T> testSet(s: Set<T>, t: T) {
}
fun <T> testMutableSet(s: MutableSet<T>, t: T) {
s.size()
s.size
s.isEmpty()
s.contains(1)
val <!UNUSED_VARIABLE!>iterator<!>: Iterator<T> = s.iterator()
@@ -1,8 +1,8 @@
package i
val <T> List<T>.length = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>size()<!>
val <T> List<T>.length = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>size<!>
val <T> List<T>.length1 : Int get() = size()
val <T> List<T>.length1 : Int get() = size
val String.bd = <!EXTENSION_PROPERTY_WITH_BACKING_FIELD!>this + "!"<!>
@@ -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)
}
@@ -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
}
@@ -19,6 +19,6 @@ fun testB(b: B<*, *>) {
b.r().checkType { _<Any?>() }
b.t().checkType { _<B<List<*>, *>>() }
b.t().r().size()
b.t().r().size
}