diff --git a/compiler/testData/codegen/box/bridges/strListContains.kt b/compiler/testData/codegen/box/bridges/strListContains.kt index 98887937e96..9b6fbd2e06f 100644 --- a/compiler/testData/codegen/box/bridges/strListContains.kt +++ b/compiler/testData/codegen/box/bridges/strListContains.kt @@ -2,7 +2,7 @@ class StrList : List { override val size: Int get() = throw UnsupportedOperationException() - override fun isEmpty(): Boolean { + override val isEmpty: Boolean get() { throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/box/builtinStubMethods/Collection.kt b/compiler/testData/codegen/box/builtinStubMethods/Collection.kt index 44f9b031a08..bc7e2994964 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/Collection.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/Collection.kt @@ -1,6 +1,6 @@ class MyCollection: Collection { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun contains(o: T): Boolean = false override fun iterator(): Iterator = throw UnsupportedOperationException() override fun containsAll(c: Collection): Boolean = false diff --git a/compiler/testData/codegen/box/builtinStubMethods/List.kt b/compiler/testData/codegen/box/builtinStubMethods/List.kt index 6f441a95162..3ea416f1630 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/List.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/List.kt @@ -1,6 +1,6 @@ class MyList: List { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun contains(o: T): Boolean = false override fun iterator(): Iterator = throw Error() override fun containsAll(c: Collection): Boolean = false diff --git a/compiler/testData/codegen/box/builtinStubMethods/ListWithAllImplementations.kt b/compiler/testData/codegen/box/builtinStubMethods/ListWithAllImplementations.kt index 7f021222b69..b9d7cc9a293 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/ListWithAllImplementations.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/ListWithAllImplementations.kt @@ -1,6 +1,6 @@ class MyList(val v: T): List { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun contains(o: T): Boolean = false override fun iterator(): Iterator = throw Error() override fun containsAll(c: Collection): Boolean = false diff --git a/compiler/testData/codegen/box/builtinStubMethods/ListWithAllInheritedImplementations.kt b/compiler/testData/codegen/box/builtinStubMethods/ListWithAllInheritedImplementations.kt index 057fc92a327..54fabc3117e 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/ListWithAllInheritedImplementations.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/ListWithAllInheritedImplementations.kt @@ -13,7 +13,7 @@ open class Super(val v: T) { class MyList(v: T): Super(v), List { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun contains(o: T): Boolean = false override fun iterator(): Iterator = throw Error() override fun containsAll(c: Collection): Boolean = false diff --git a/compiler/testData/codegen/box/builtinStubMethods/Map.kt b/compiler/testData/codegen/box/builtinStubMethods/Map.kt index 64b810d6e81..dae89e07c5d 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/Map.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/Map.kt @@ -1,6 +1,6 @@ class MyMap: Map { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun containsKey(key: Any?): Boolean = false override fun containsValue(value: Any?): Boolean = false override fun get(key: Any?): V? = null diff --git a/compiler/testData/codegen/box/builtinStubMethods/MapEntry.kt b/compiler/testData/codegen/box/builtinStubMethods/MapEntry.kt index d7ef8b616f7..377537acff0 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/MapEntry.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/MapEntry.kt @@ -1,8 +1,8 @@ class MyMapEntry: Map.Entry { override fun hashCode(): Int = 0 override fun equals(other: Any?): Boolean = false - override fun getKey(): K = throw UnsupportedOperationException() - override fun getValue(): V = throw UnsupportedOperationException() + override val key: K get() = throw UnsupportedOperationException() + override val value: V get() = throw UnsupportedOperationException() } fun box(): String { diff --git a/compiler/testData/codegen/box/builtinStubMethods/MapEntryWithSetValue.kt b/compiler/testData/codegen/box/builtinStubMethods/MapEntryWithSetValue.kt index b5d8f74eb53..f152117d033 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/MapEntryWithSetValue.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/MapEntryWithSetValue.kt @@ -1,8 +1,8 @@ class MyMapEntry: Map.Entry { override fun hashCode(): Int = 0 override fun equals(other: Any?): Boolean = false - override fun getKey(): K = throw UnsupportedOperationException() - override fun getValue(): V = throw UnsupportedOperationException() + override val key: K get() = throw UnsupportedOperationException() + override val value: V get() = throw UnsupportedOperationException() public fun setValue(value: V): V = value } diff --git a/compiler/testData/codegen/box/builtinStubMethods/MapWithAllImplementations.kt b/compiler/testData/codegen/box/builtinStubMethods/MapWithAllImplementations.kt index 017618c887b..8a3ff2b93b9 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/MapWithAllImplementations.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/MapWithAllImplementations.kt @@ -1,6 +1,6 @@ class MyMap: Map { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun containsKey(key: Any?): Boolean = false override fun containsValue(value: Any?): Boolean = false override fun get(key: Any?): V? = null diff --git a/compiler/testData/codegen/box/builtinStubMethods/SubstitutedList.kt b/compiler/testData/codegen/box/builtinStubMethods/SubstitutedList.kt index 473aea37f55..54a44e7380a 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/SubstitutedList.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/SubstitutedList.kt @@ -1,6 +1,6 @@ class MyList: List { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun contains(o: String): Boolean = false override fun iterator(): Iterator = throw Error() override fun containsAll(c: Collection): Boolean = false diff --git a/compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt b/compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt index 65eaff7f18b..bf86c082492 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt @@ -4,7 +4,7 @@ interface Addable { class C : Addable, List { override val size: Int get() = null!! - override fun isEmpty(): Boolean = null!! + override val isEmpty: Boolean get() = null!! override fun contains(o: String): Boolean = null!! override fun iterator(): Iterator = null!! override fun containsAll(c: Collection): Boolean = null!! diff --git a/compiler/testData/codegen/box/builtinStubMethods/inheritedImplementations.kt b/compiler/testData/codegen/box/builtinStubMethods/inheritedImplementations.kt index e73d5b30b7d..2ff81b7308b 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/inheritedImplementations.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/inheritedImplementations.kt @@ -6,7 +6,7 @@ open class SetStringImpl { class S : Set, SetStringImpl() { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun contains(o: String): Boolean = false override fun iterator(): Iterator = null!! override fun containsAll(c: Collection) = false diff --git a/compiler/testData/codegen/box/builtinStubMethods/manyTypeParametersWithUpperBounds.kt b/compiler/testData/codegen/box/builtinStubMethods/manyTypeParametersWithUpperBounds.kt index 244266cc0b6..2712c9e9ca8 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/manyTypeParametersWithUpperBounds.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/manyTypeParametersWithUpperBounds.kt @@ -2,10 +2,10 @@ import java.util.Collections class A : Set { override val size: Int get() = 0 - override fun isEmpty(): Boolean = true + override val isEmpty: Boolean get() = true override fun contains(o: W): Boolean = false override fun iterator(): Iterator = Collections.emptySet().iterator() - override fun containsAll(c: Collection): Boolean = c.isEmpty() + override fun containsAll(c: Collection): Boolean = c.isEmpty } fun expectUoe(block: () -> Any) { diff --git a/compiler/testData/codegen/box/builtinStubMethods/nonTrivialSubstitution.kt b/compiler/testData/codegen/box/builtinStubMethods/nonTrivialSubstitution.kt index b77fd967035..edf51eafcd0 100644 --- a/compiler/testData/codegen/box/builtinStubMethods/nonTrivialSubstitution.kt +++ b/compiler/testData/codegen/box/builtinStubMethods/nonTrivialSubstitution.kt @@ -3,7 +3,7 @@ import java.util.ArrayList class MyCollection : Collection>> { override fun iterator() = null!! override val size: Int get() = null!! - override fun isEmpty(): Boolean = null!! + override val isEmpty: Boolean get() = null!! override fun contains(o: List>): Boolean = null!! override fun containsAll(c: Collection>>): Boolean = null!! } diff --git a/compiler/testData/codegen/box/builtinsProperties/bridges.kt b/compiler/testData/codegen/box/builtinsProperties/bridges.kt index 6cefaf826bd..2dffb290490 100644 --- a/compiler/testData/codegen/box/builtinsProperties/bridges.kt +++ b/compiler/testData/codegen/box/builtinsProperties/bridges.kt @@ -5,7 +5,7 @@ interface A0 { } class B0 : Collection, A0 { - override fun isEmpty() = throw UnsupportedOperationException() + override val isEmpty: Boolean get() = throw UnsupportedOperationException() override fun contains(o: String) = throw UnsupportedOperationException() override fun iterator() = throw UnsupportedOperationException() override fun containsAll(c: Collection) = throw UnsupportedOperationException() @@ -16,7 +16,7 @@ open class A1 { } class B1 : Collection, A1() { - override fun isEmpty() = throw UnsupportedOperationException() + override val isEmpty: Boolean get() = throw UnsupportedOperationException() override fun contains(o: String) = throw UnsupportedOperationException() override fun iterator() = throw UnsupportedOperationException() override fun containsAll(c: Collection) = throw UnsupportedOperationException() @@ -41,7 +41,7 @@ interface I4 { } class B4 : Collection, I4 { - override fun isEmpty() = throw UnsupportedOperationException() + override val isEmpty: Boolean get() = throw UnsupportedOperationException() override fun contains(o: String) = throw UnsupportedOperationException() override fun iterator() = throw UnsupportedOperationException() override fun containsAll(c: Collection) = throw UnsupportedOperationException() @@ -52,7 +52,7 @@ interface I5 : Collection { } class B5 : I5 { - override fun isEmpty() = throw UnsupportedOperationException() + override val isEmpty: Boolean get() = throw UnsupportedOperationException() override fun contains(o: String) = throw UnsupportedOperationException() override fun iterator() = throw UnsupportedOperationException() override fun containsAll(c: Collection) = throw UnsupportedOperationException() diff --git a/compiler/testData/codegen/box/builtinsProperties/collectionImpl.kt b/compiler/testData/codegen/box/builtinsProperties/collectionImpl.kt index 7e1c21758ab..4bc827ba41b 100644 --- a/compiler/testData/codegen/box/builtinsProperties/collectionImpl.kt +++ b/compiler/testData/codegen/box/builtinsProperties/collectionImpl.kt @@ -2,7 +2,7 @@ class A1 : MutableCollection { override val size: Int get() = 56 - override fun isEmpty(): Boolean { + override val isEmpty: Boolean get() { throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/box/builtinsProperties/maps.kt b/compiler/testData/codegen/box/builtinsProperties/maps.kt index cca4594f5d8..6a78de99b6a 100644 --- a/compiler/testData/codegen/box/builtinsProperties/maps.kt +++ b/compiler/testData/codegen/box/builtinsProperties/maps.kt @@ -1,7 +1,7 @@ class A : Map { override val size: Int get() = 56 - override fun isEmpty(): Boolean { + override val isEmpty: Boolean get() { throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithJava/builtinStubMethods/substitutedList/substitutedList.kt b/compiler/testData/codegen/boxWithJava/builtinStubMethods/substitutedList/substitutedList.kt index f90a0b07117..585a3ed30b6 100644 --- a/compiler/testData/codegen/boxWithJava/builtinStubMethods/substitutedList/substitutedList.kt +++ b/compiler/testData/codegen/boxWithJava/builtinStubMethods/substitutedList/substitutedList.kt @@ -1,6 +1,6 @@ abstract class C : Test.A, List { override val size: Int get() = null!! - override fun isEmpty(): Boolean = null!! + override val isEmpty: Boolean get() = null!! override fun contains(o: String): Boolean = null!! override fun iterator(): Iterator = null!! override fun containsAll(c: Collection): Boolean = null!! diff --git a/compiler/testData/codegen/boxWithJava/collections/mutableList/mutableList.kt b/compiler/testData/codegen/boxWithJava/collections/mutableList/mutableList.kt index e01cf058ed9..7e00a59f05c 100644 --- a/compiler/testData/codegen/boxWithJava/collections/mutableList/mutableList.kt +++ b/compiler/testData/codegen/boxWithJava/collections/mutableList/mutableList.kt @@ -58,7 +58,7 @@ open class KList : MutableList { override val size: Int get() = throw UnsupportedOperationException() - override fun isEmpty(): Boolean { + override val isEmpty: Boolean get() { throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithJava/collections/strList/strList.kt b/compiler/testData/codegen/boxWithJava/collections/strList/strList.kt index 0d16bb3034c..b1656f2fb66 100644 --- a/compiler/testData/codegen/boxWithJava/collections/strList/strList.kt +++ b/compiler/testData/codegen/boxWithJava/collections/strList/strList.kt @@ -2,7 +2,7 @@ open class KList : MutableList { override val size: Int get() = throw UnsupportedOperationException() - override fun isEmpty(): Boolean { + override val isEmpty: Boolean get() { throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithStdlib/casts/asWithMutable.kt b/compiler/testData/codegen/boxWithStdlib/casts/asWithMutable.kt index 83f18bb984d..12285e59f79 100644 --- a/compiler/testData/codegen/boxWithStdlib/casts/asWithMutable.kt +++ b/compiler/testData/codegen/boxWithStdlib/casts/asWithMutable.kt @@ -18,13 +18,13 @@ class M : Map by HashMap() class MM : MutableMap by HashMap() class ME : Map.Entry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() } class MME : MutableMap.MutableEntry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() override fun setValue(value: String): String = throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithStdlib/casts/isWithMutable.kt b/compiler/testData/codegen/boxWithStdlib/casts/isWithMutable.kt index 28e9619d76a..b1fd027b6be 100644 --- a/compiler/testData/codegen/boxWithStdlib/casts/isWithMutable.kt +++ b/compiler/testData/codegen/boxWithStdlib/casts/isWithMutable.kt @@ -18,13 +18,13 @@ class M : Map by HashMap() class MM : MutableMap by HashMap() class ME : Map.Entry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() } class MME : MutableMap.MutableEntry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() override fun setValue(value: String): String = throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithStdlib/casts/reifiedAsWithMutable.kt b/compiler/testData/codegen/boxWithStdlib/casts/reifiedAsWithMutable.kt index d34bb166d8e..75d871e2ba0 100644 --- a/compiler/testData/codegen/boxWithStdlib/casts/reifiedAsWithMutable.kt +++ b/compiler/testData/codegen/boxWithStdlib/casts/reifiedAsWithMutable.kt @@ -18,13 +18,13 @@ class M : Map by HashMap() class MM : MutableMap by HashMap() class ME : Map.Entry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() } class MME : MutableMap.MutableEntry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() override fun setValue(value: String): String = throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithStdlib/casts/reifiedIsWithMutable.kt b/compiler/testData/codegen/boxWithStdlib/casts/reifiedIsWithMutable.kt index a333e4e561a..796d747f7bc 100644 --- a/compiler/testData/codegen/boxWithStdlib/casts/reifiedIsWithMutable.kt +++ b/compiler/testData/codegen/boxWithStdlib/casts/reifiedIsWithMutable.kt @@ -18,13 +18,13 @@ class M : Map by HashMap() class MM : MutableMap by HashMap() class ME : Map.Entry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() } class MME : MutableMap.MutableEntry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() override fun setValue(value: String): String = throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithStdlib/casts/reifiedSafeAsWithMutable.kt b/compiler/testData/codegen/boxWithStdlib/casts/reifiedSafeAsWithMutable.kt index ce844dfe1ee..e0fe12979c6 100644 --- a/compiler/testData/codegen/boxWithStdlib/casts/reifiedSafeAsWithMutable.kt +++ b/compiler/testData/codegen/boxWithStdlib/casts/reifiedSafeAsWithMutable.kt @@ -18,13 +18,13 @@ class M : Map by HashMap() class MM : MutableMap by HashMap() class ME : Map.Entry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() } class MME : MutableMap.MutableEntry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() override fun setValue(value: String): String = throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithStdlib/casts/safeAsWithMutable.kt b/compiler/testData/codegen/boxWithStdlib/casts/safeAsWithMutable.kt index 38476d39db4..d07e286a451 100644 --- a/compiler/testData/codegen/boxWithStdlib/casts/safeAsWithMutable.kt +++ b/compiler/testData/codegen/boxWithStdlib/casts/safeAsWithMutable.kt @@ -18,13 +18,13 @@ class M : Map by HashMap() class MM : MutableMap by HashMap() class ME : Map.Entry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() } class MME : MutableMap.MutableEntry { - override fun getKey(): String = throw UnsupportedOperationException() - override fun getValue(): String = throw UnsupportedOperationException() + override val key: String get() = throw UnsupportedOperationException() + override val value: String get() = throw UnsupportedOperationException() override fun setValue(value: String): String = throw UnsupportedOperationException() } diff --git a/compiler/testData/codegen/boxWithStdlib/casts/weirdMutableCasts.kt b/compiler/testData/codegen/boxWithStdlib/casts/weirdMutableCasts.kt index aa63dbe74b4..29917efac34 100644 --- a/compiler/testData/codegen/boxWithStdlib/casts/weirdMutableCasts.kt +++ b/compiler/testData/codegen/boxWithStdlib/casts/weirdMutableCasts.kt @@ -3,8 +3,8 @@ fun unsupported(): Nothing = throw UnsupportedOperationException() class Weird : Iterator, MutableIterable, MutableMap.MutableEntry { override fun next(): String = unsupported() override fun hasNext(): Boolean = unsupported() - override fun getKey(): String = unsupported() - override fun getValue(): String = unsupported() + override val key: String get() = unsupported() + override val value: String get() = unsupported() override fun setValue(value: String): String = unsupported() override fun iterator(): MutableIterator = unsupported() } diff --git a/compiler/testData/diagnostics/tests/library/Collections.kt b/compiler/testData/diagnostics/tests/library/Collections.kt index dc26c5da7e7..809e7786e86 100644 --- a/compiler/testData/diagnostics/tests/library/Collections.kt +++ b/compiler/testData/diagnostics/tests/library/Collections.kt @@ -2,7 +2,7 @@ package collections fun testCollection(c: Collection, t: T) { c.size - c.isEmpty() + c.isEmpty c.contains(1) val iterator: Iterator = c.iterator() c.containsAll(c) @@ -18,7 +18,7 @@ fun testCollection(c: Collection, t: T) { } fun testMutableCollection(c: MutableCollection, t: T) { c.size - c.isEmpty() + c.isEmpty c.contains(1) val iterator: Iterator = c.iterator() c.containsAll(c) @@ -60,7 +60,7 @@ fun testMutableList(l: MutableList, t: T) { fun testSet(s: Set, t: T) { s.size - s.isEmpty() + s.isEmpty s.contains(1) val iterator: Iterator = s.iterator() s.containsAll(s) @@ -76,7 +76,7 @@ fun testSet(s: Set, t: T) { } fun testMutableSet(s: MutableSet, t: T) { s.size - s.isEmpty() + s.isEmpty s.contains(1) val iterator: Iterator = s.iterator() s.containsAll(s)