diff --git a/compiler/testData/codegen/box/builtinStubMethods/Collection.kt b/compiler/testData/codegen/box/builtinStubMethods/Collection.kt index 27aa6a4e5cd..54d4e3b93a2 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/Collection.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/Collection.kt @@ -1,5 +1,5 @@ class MyCollection: Collection { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun contains(o: Any?): Boolean = false override fun iterator(): Iterator = throw UnsupportedOperationException() diff --git a/compiler/testData/codegen/box/builtinStubMethods/List.kt b/compiler/testData/codegen/box/builtinStubMethods/List.kt index 004da9106b2..c86bc92b9ac 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/List.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/List.kt @@ -1,5 +1,5 @@ class MyList: List { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun contains(o: Any?): Boolean = false override fun iterator(): Iterator = throw Error() diff --git a/compiler/testData/codegen/box/builtinStubMethods/ListWithAllImplementations.kt b/compiler/testData/codegen/box/builtinStubMethods/ListWithAllImplementations.kt index 26d266a050f..bd2f143558f 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/ListWithAllImplementations.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/ListWithAllImplementations.kt @@ -1,5 +1,5 @@ class MyList(val v: T): List { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun contains(o: Any?): Boolean = false override fun iterator(): Iterator = throw Error() diff --git a/compiler/testData/codegen/box/builtinStubMethods/ListWithAllInheritedImplementations.kt b/compiler/testData/codegen/box/builtinStubMethods/ListWithAllInheritedImplementations.kt index 9782d0707ef..afa2e7b48bb 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/ListWithAllInheritedImplementations.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/ListWithAllInheritedImplementations.kt @@ -12,7 +12,7 @@ open class Super(val v: T) { } class MyList(v: T): Super(v), List { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun contains(o: Any?): Boolean = false override fun iterator(): Iterator = throw Error() diff --git a/compiler/testData/codegen/box/builtinStubMethods/Map.kt b/compiler/testData/codegen/box/builtinStubMethods/Map.kt index b5cf8d4bfb8..64b810d6e81 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/Map.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/Map.kt @@ -1,5 +1,5 @@ class MyMap: Map { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun containsKey(key: Any?): Boolean = false override fun containsValue(value: Any?): Boolean = false diff --git a/compiler/testData/codegen/box/builtinStubMethods/MapWithAllImplementations.kt b/compiler/testData/codegen/box/builtinStubMethods/MapWithAllImplementations.kt index da5c2b4e353..017618c887b 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/MapWithAllImplementations.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/MapWithAllImplementations.kt @@ -1,5 +1,5 @@ class MyMap: Map { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun containsKey(key: Any?): Boolean = false override fun containsValue(value: Any?): Boolean = false diff --git a/compiler/testData/codegen/box/builtinStubMethods/SubstitutedList.kt b/compiler/testData/codegen/box/builtinStubMethods/SubstitutedList.kt index ce331e76102..f99bb987d57 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/SubstitutedList.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/SubstitutedList.kt @@ -1,5 +1,5 @@ class MyList: List { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun contains(o: Any?): Boolean = false override fun iterator(): Iterator = throw Error() diff --git a/compiler/testData/codegen/box/builtinStubMethods/extendJavaCollections/abstractList.kt b/compiler/testData/codegen/box/builtinStubMethods/extendJavaCollections/abstractList.kt index e339325fe33..65df2f6f5f7 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/extendJavaCollections/abstractList.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/extendJavaCollections/abstractList.kt @@ -2,7 +2,7 @@ import java.util.AbstractList class A : AbstractList() { override fun get(index: Int): String = "" - override fun size(): Int = 0 + override val size: Int get() = 0 } fun box(): String { diff --git a/compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt b/compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt index a3c41808fce..d645e4e146d 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt @@ -3,7 +3,7 @@ interface Addable { } class C : Addable, List { - override fun size(): Int = null!! + override val size: Int get() = null!! override fun isEmpty(): Boolean = null!! override fun contains(o: Any?): Boolean = null!! override fun iterator(): Iterator = null!! diff --git a/compiler/testData/codegen/box/builtinStubMethods/inheritedImplementations.kt b/compiler/testData/codegen/box/builtinStubMethods/inheritedImplementations.kt index 9395f57144d..a039ac792e8 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/inheritedImplementations.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/inheritedImplementations.kt @@ -5,7 +5,7 @@ open class SetStringImpl { } class S : Set, SetStringImpl() { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun contains(o: Any?): Boolean = false override fun iterator(): Iterator = null!! diff --git a/compiler/testData/codegen/box/builtinStubMethods/manyTypeParametersWithUpperBounds.kt b/compiler/testData/codegen/box/builtinStubMethods/manyTypeParametersWithUpperBounds.kt index 39667864f50..137831502bb 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/manyTypeParametersWithUpperBounds.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/manyTypeParametersWithUpperBounds.kt @@ -1,7 +1,7 @@ import java.util.Collections class A : Set { - override fun size(): Int = 0 + override val size: Int get() = 0 override fun isEmpty(): Boolean = true override fun contains(o: Any?): Boolean = false override fun iterator(): Iterator = Collections.emptySet().iterator() diff --git a/compiler/testData/codegen/box/builtinStubMethods/nonTrivialSubstitution.kt b/compiler/testData/codegen/box/builtinStubMethods/nonTrivialSubstitution.kt index f597cce81d8..3186ef6eeb5 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/nonTrivialSubstitution.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/nonTrivialSubstitution.kt @@ -2,7 +2,7 @@ import java.util.ArrayList class MyCollection : Collection>> { override fun iterator() = null!! - override fun size(): Int = null!! + override val size: Int get() = null!! override fun isEmpty(): Boolean = null!! override fun contains(o: Any?): Boolean = null!! override fun containsAll(c: Collection): Boolean = null!! diff --git a/compiler/testData/codegen/box/classes/initializerBlockDImpl.kt b/compiler/testData/codegen/box/classes/initializerBlockDImpl.kt index 47cd1553ed5..0cfebf0b790 100644 --- a/compiler/testData/codegen/box/classes/initializerBlockDImpl.kt +++ b/compiler/testData/codegen/box/classes/initializerBlockDImpl.kt @@ -15,6 +15,6 @@ class World() { fun box() : String { val w = World() - if (w.items.size() != 1) return "fail" + if (w.items.size != 1) return "fail" return "OK" } diff --git a/compiler/testData/codegen/box/classes/kt2395.kt b/compiler/testData/codegen/box/classes/kt2395.kt index a3578106dd7..40ee9b9495c 100644 --- a/compiler/testData/codegen/box/classes/kt2395.kt +++ b/compiler/testData/codegen/box/classes/kt2395.kt @@ -3,7 +3,7 @@ import java.util.AbstractList class MyList(): AbstractList() { public fun getModificationCount(): Int = modCount public override fun get(index: Int): String = "" - public override fun size(): Int = 0 + public override val size: Int get() = 0 } fun box(): String { diff --git a/compiler/testData/codegen/box/classes/kt343.kt b/compiler/testData/codegen/box/classes/kt343.kt index 9f04f884f7c..43428768d70 100644 --- a/compiler/testData/codegen/box/classes/kt343.kt +++ b/compiler/testData/codegen/box/classes/kt343.kt @@ -20,5 +20,5 @@ fun box(): String { } bar() - return if (list.size() == 2 && list.get(0) == 2 && list.get(1) == 3) "OK" else "fail" + return if (list.size == 2 && list.get(0) == 2 && list.get(1) == 3) "OK" else "fail" } diff --git a/compiler/testData/codegen/box/classes/overloadBinaryOperator.kt b/compiler/testData/codegen/box/classes/overloadBinaryOperator.kt index bee66062979..4432afe92ec 100644 --- a/compiler/testData/codegen/box/classes/overloadBinaryOperator.kt +++ b/compiler/testData/codegen/box/classes/overloadBinaryOperator.kt @@ -21,5 +21,5 @@ fun box(): String { v1.add("foo") v2.add("bar") val v3 = v1 + v2 - return if (v3.contents.size() == 2) "OK" else "fail" + return if (v3.contents.size == 2) "OK" else "fail" } diff --git a/compiler/testData/codegen/box/classes/overloadPlusAssign.kt b/compiler/testData/codegen/box/classes/overloadPlusAssign.kt index 5e9b4a09eb9..528a3e88704 100644 --- a/compiler/testData/codegen/box/classes/overloadPlusAssign.kt +++ b/compiler/testData/codegen/box/classes/overloadPlusAssign.kt @@ -22,5 +22,5 @@ fun box(): String { v1.add("foo") v2.add("bar") v1 += v2 - return if (v1.contents.size() == 2) "OK" else "fail" + return if (v1.contents.size == 2) "OK" else "fail" } diff --git a/compiler/testData/codegen/box/classes/overloadPlusAssignReturn.kt b/compiler/testData/codegen/box/classes/overloadPlusAssignReturn.kt index 2a4912f1e94..0419b444049 100644 --- a/compiler/testData/codegen/box/classes/overloadPlusAssignReturn.kt +++ b/compiler/testData/codegen/box/classes/overloadPlusAssignReturn.kt @@ -26,5 +26,5 @@ fun box(): String { val v3 = v1 v2.add("bar") v1 += v2 - return if (v1.contents.size() == 2 && v3.contents.size() == 1) "OK" else "fail" + return if (v1.contents.size == 2 && v3.contents.size == 1) "OK" else "fail" } diff --git a/compiler/testData/codegen/box/classes/overloadPlusToPlusAssign.kt b/compiler/testData/codegen/box/classes/overloadPlusToPlusAssign.kt index 2a4912f1e94..0419b444049 100644 --- a/compiler/testData/codegen/box/classes/overloadPlusToPlusAssign.kt +++ b/compiler/testData/codegen/box/classes/overloadPlusToPlusAssign.kt @@ -26,5 +26,5 @@ fun box(): String { val v3 = v1 v2.add("bar") v1 += v2 - return if (v1.contents.size() == 2 && v3.contents.size() == 1) "OK" else "fail" + return if (v1.contents.size == 2 && v3.contents.size == 1) "OK" else "fail" } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataEqualsHashCodeToString.kt b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataEqualsHashCodeToString.kt index 98b22dc2b43..cddf2cd6487 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataEqualsHashCodeToString.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataEqualsHashCodeToString.kt @@ -25,7 +25,7 @@ fun box(): String { foo 42.foo - if (O.metadatas.size() != 1) + if (O.metadatas.size != 1) return "Too many different PropertyMetadata instances: ${O.metadatas}" val m = O.metadatas.iterator().next() diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt index 08234dd1373..49d26c466e3 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt @@ -39,7 +39,7 @@ fun box(): String { A.bar = baz + a.foo baz + A.bar - if (metadatas.keySet().size() != 3) + if (metadatas.keySet().size != 3) return "Fail: only three instances of PropertyMetadata should have been created\n${metadatas.keySet()}" return "OK" diff --git a/compiler/testData/codegen/box/extensionFunctions/kt475.kt b/compiler/testData/codegen/box/extensionFunctions/kt475.kt index e6dee342926..cad63b94d95 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt475.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt475.kt @@ -10,9 +10,9 @@ fun box() : String { } var ArrayList.length : Int - get() = size() + get() = size set(value: Int) = throw java.lang.Error() var ArrayList.last : T - get() = get(size()-1)!! - set(el : T) { set(size()-1, el) } + get() = get(size-1)!! + set(el : T) { set(size-1, el) } diff --git a/compiler/testData/codegen/box/extensionFunctions/kt865.kt b/compiler/testData/codegen/box/extensionFunctions/kt865.kt index c13aba50662..c9a575f7238 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt865.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt865.kt @@ -15,5 +15,5 @@ class Template() { fun box() : String { val u = Template() u.test() - return if(u.collected.size() == 1 && u.collected.get(0) == "239") "OK" else "fail" + return if(u.collected.size == 1 && u.collected.get(0) == "239") "OK" else "fail" } diff --git a/compiler/testData/codegen/box/vararg/kt581.kt b/compiler/testData/codegen/box/vararg/kt581.kt index 50ce681cd35..c3e0a729819 100644 --- a/compiler/testData/codegen/box/vararg/kt581.kt +++ b/compiler/testData/codegen/box/vararg/kt581.kt @@ -12,7 +12,7 @@ fun box() : String { for (i in vals.indices) for (j in i..vals.lastIndex()) diffs.add(vals[i] - vals[j]) - val size = diffs.size() + val size = diffs.size if (size != 8) return "Fail $size" return "OK" diff --git a/compiler/testData/codegen/boxWithJava/builtinStubMethods/substitutedList/substitutedList.kt b/compiler/testData/codegen/boxWithJava/builtinStubMethods/substitutedList/substitutedList.kt index e9b64a54ca1..e698f95710e 100644 --- a/compiler/testData/codegen/boxWithJava/builtinStubMethods/substitutedList/substitutedList.kt +++ b/compiler/testData/codegen/boxWithJava/builtinStubMethods/substitutedList/substitutedList.kt @@ -1,5 +1,5 @@ abstract class C : Test.A, List { - override fun size(): Int = null!! + override val size: Int get() = null!! override fun isEmpty(): Boolean = null!! override fun contains(o: Any?): Boolean = null!! override fun iterator(): Iterator = null!! diff --git a/compiler/testData/codegen/controlStructures/ifBlock.kt b/compiler/testData/codegen/controlStructures/ifBlock.kt index 4905fb2efc6..9afdccdc69b 100644 --- a/compiler/testData/codegen/controlStructures/ifBlock.kt +++ b/compiler/testData/codegen/controlStructures/ifBlock.kt @@ -3,7 +3,7 @@ import java.util.* fun concat(l: List): String? { val sb = StringBuilder() for(s in l) { - val x = if(l.size() > 1) { "T" } else { "F" }; + val x = if(l.size > 1) { "T" } else { "F" }; sb.append(x) } return sb.toString() diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2179.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2179.kt index 94308ae2ab7..d079e8e0ca1 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2179.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2179.kt @@ -43,4 +43,4 @@ fun > Array.toCollection(result: C) : C { } val Collection<*>.size : Int - get() = size() + get() = size diff --git a/compiler/testData/diagnostics/tests/library/Collections.kt b/compiler/testData/diagnostics/tests/library/Collections.kt index ec2447685af..7fb089478b9 100644 --- a/compiler/testData/diagnostics/tests/library/Collections.kt +++ b/compiler/testData/diagnostics/tests/library/Collections.kt @@ -1,7 +1,7 @@ package collections fun testCollection(c: Collection, t: T) { - c.size() + c.size c.isEmpty() c.contains(1) val iterator: Iterator = c.iterator() @@ -17,7 +17,7 @@ fun testCollection(c: Collection, t: T) { } fun testMutableCollection(c: MutableCollection, t: T) { - c.size() + c.size c.isEmpty() c.contains(1) val iterator: Iterator = c.iterator() @@ -59,7 +59,7 @@ fun testMutableList(l: MutableList, t: T) { } fun testSet(s: Set, t: T) { - s.size() + s.size s.isEmpty() s.contains(1) val iterator: Iterator = s.iterator() @@ -75,7 +75,7 @@ fun testSet(s: Set, t: T) { } fun testMutableSet(s: MutableSet, t: T) { - s.size() + s.size s.isEmpty() s.contains(1) val iterator: Iterator = s.iterator() diff --git a/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.kt b/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.kt index e5ffcb22b19..00b5bcc97aa 100644 --- a/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.kt +++ b/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.kt @@ -1,8 +1,8 @@ package i -val List.length = size() +val List.length = size -val List.length1 : Int get() = size() +val List.length1 : Int get() = size val String.bd = this + "!" diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/anotherVal.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/anotherVal.kt index 12ca8333e34..e9eb51c37b5 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/anotherVal.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/anotherVal.kt @@ -2,5 +2,5 @@ fun calc(x: List?, y: Int?): Int { x?.get(y!! - 1) // y!! above should not provide smart cast here val yy: Int = y - return yy + (x?.size() ?: 0) + return yy + (x?.size ?: 0) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.kt index b8b751ecc9e..049e007c508 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.kt @@ -1,6 +1,6 @@ fun calc(x: List?): Int { // After KT-5840 fix !! assertion should become unnecessary here - x?.get(x!!.size() - 1) + x?.get(x!!.size - 1) // x?. or x!! above should not provide smart cast here - return x.size() + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainAndUse.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainAndUse.kt index 9837313f1e1..315aecd67f7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainAndUse.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainAndUse.kt @@ -1,6 +1,6 @@ fun calc(x: List?): Int { // x should be non-null in arguments list, despite of a chain - x?.subList(0, 1)?.get(x.size()) + x?.subList(0, 1)?.get(x.size) // But not here! - return x!!.size() + return x!!.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainInChain.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainInChain.kt index 1bb82555bd9..37eaf0ccdd9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainInChain.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainInChain.kt @@ -1,6 +1,6 @@ fun calc(x: List?, y: List?) { // x and y should be non-null in arguments list, despite of a chains - x?.subList(y?.subList(1, 2)?.get(y.size()) ?: 0, + x?.subList(y?.subList(1, 2)?.get(y.size) ?: 0, y?.get(0) ?: 1) // But safe call is NECESSARY here for y - ?.get(x.size()) + ?.get(x.size) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.kt index 14dee286e07..510272128ed 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.kt @@ -1,6 +1,6 @@ fun calc(x: List?): Int { // x should be non-null in arguments list, despite of a chain - x?.subList(0, 1).get(x.size()) + x?.subList(0, 1).get(x.size) // But not here! - return x!!.size() + return x!!.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.kt index 7723645bfce..bf551175f8f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.kt @@ -1,6 +1,6 @@ fun calc(x: List?): Int { // x should be non-null in arguments list, including inner call - x?.get(x.get(x.size() - 1).length()) + x?.get(x.get(x.size - 1).length()) // but not also here! - return x.size() + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseArgument.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseArgument.kt index 5a1a1e230b2..890a102bd86 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseArgument.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseArgument.kt @@ -1,7 +1,7 @@ fun foo(y: Int) = y fun calc(x: List?): Int { - foo(x!!.size()) + foo(x!!.size) // Here we should have smart cast because of x!!, despite of KT-7204 fixed - return x.size() + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseExtension.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseExtension.kt index 5f87c4b5dd5..fa0e1e87a51 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseExtension.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseExtension.kt @@ -1,7 +1,7 @@ fun String.foo(y: Int) = y fun calc(x: List?): Int { - "abc".foo(x!!.size()) + "abc".foo(x!!.size) // Here we should have smart cast because of x!!, despite of KT-7204 fixed - return x.size() + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideCall.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideCall.kt index 7f59458d336..bd716372771 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideCall.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideCall.kt @@ -4,5 +4,5 @@ fun foo(y: Int): Int { fun calc(x: List?): Int { // x should be non-null in arguments list - return foo(x?.get(x.size() - 1)!!.length()) + return foo(x?.get(x.size - 1)!!.length()) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/longChain.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/longChain.kt index ff79102eb23..66d72193f41 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/longChain.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/longChain.kt @@ -1,6 +1,6 @@ fun calc(x: List?) { // x should be non-null in arguments list, despite of a chain - x?.subList(0, x.size())?. - subList(0, x.size())?. - get(x.size()) + x?.subList(0, x.size)?. + subList(0, x.size)?. + get(x.size) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.kt index c7bcde5512c..b7e684fce05 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.kt @@ -1,6 +1,6 @@ fun calc(x: List?): Int { // x should be non-null in arguments list - x?.get(x.size() - 1) + x?.get(x.size - 1) // but not also here! - return x.size() + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.kt index b1a5aa039f5..1ae7d954016 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.kt @@ -1,6 +1,6 @@ fun calc(x: List?): Int { // x should be non-null in arguments list - x?.subList(x.size() - 1, x.size()) + x?.subList(x.size - 1, x.size) // but not also here! - return x.size() + return x.size } diff --git a/compiler/testData/diagnostics/tests/substitutions/starProjections.kt b/compiler/testData/diagnostics/tests/substitutions/starProjections.kt index 05ac2b406ef..addb685fa37 100644 --- a/compiler/testData/diagnostics/tests/substitutions/starProjections.kt +++ b/compiler/testData/diagnostics/tests/substitutions/starProjections.kt @@ -19,6 +19,6 @@ fun testB(b: B<*, *>) { b.r().checkType { _() } b.t().checkType { _, *>>() } - b.t().r().size() + b.t().r().size }