diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt index ed62e9ba017..b1b585f14a2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/constants/evaluate/OperationsMapGenerated.kt @@ -348,7 +348,6 @@ internal val binaryOperations: HashMap, Pair a.times(b) }, { a, b -> a.multiply(b) }), binaryOperation(SHORT, SHORT, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), binaryOperation(SHORT, ANY, "equals", { a, b -> a.equals(b) }, emptyBinaryFun), - binaryOperation(STRING, INT, "charAt", { a, b -> a.charAt(b) }, emptyBinaryFun), binaryOperation(STRING, STRING, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(STRING, INT, "get", { a, b -> a.get(b) }, emptyBinaryFun), binaryOperation(STRING, ANY, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 74af28f14b8..10f1c398515 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -262,7 +262,7 @@ public final class CharRange : kotlin.Range, kotlin.Progression : kotlin.Collection, kotlin.Mutab public abstract override /*1*/ /*fake_override*/ fun contains(/*0*/ o: E): kotlin.Boolean public abstract override /*1*/ /*fake_override*/ fun containsAll(/*0*/ c: kotlin.Collection): kotlin.Boolean public abstract override /*2*/ fun iterator(): kotlin.MutableIterator - public abstract fun remove(/*0*/ o: kotlin.Any?): kotlin.Boolean + public abstract fun remove(/*0*/ o: E): kotlin.Boolean public abstract fun removeAll(/*0*/ c: kotlin.Collection): kotlin.Boolean public abstract fun retainAll(/*0*/ c: kotlin.Collection): kotlin.Boolean } @@ -994,9 +994,9 @@ public interface MutableList : kotlin.List, kotlin.MutableCollection public abstract override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ o: kotlin.Any?): kotlin.Int public abstract override /*1*/ fun listIterator(): kotlin.MutableListIterator public abstract override /*1*/ fun listIterator(/*0*/ index: kotlin.Int): kotlin.MutableListIterator - public abstract override /*1*/ fun remove(/*0*/ o: kotlin.Any?): kotlin.Boolean - public abstract fun remove(/*0*/ index: kotlin.Int): E + public abstract override /*1*/ fun remove(/*0*/ o: E): kotlin.Boolean public abstract override /*1*/ fun removeAll(/*0*/ c: kotlin.Collection): kotlin.Boolean + public abstract fun removeAt(/*0*/ index: kotlin.Int): E public abstract override /*1*/ fun retainAll(/*0*/ c: kotlin.Collection): kotlin.Boolean public abstract operator fun set(/*0*/ index: kotlin.Int, /*1*/ element: E): E public abstract override /*1*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.MutableList @@ -1050,7 +1050,7 @@ public interface MutableSet : kotlin.Set, kotlin.MutableCollection): kotlin.Boolean public abstract override /*2*/ fun iterator(): kotlin.MutableIterator - public abstract override /*1*/ fun remove(/*0*/ o: kotlin.Any?): kotlin.Boolean + public abstract override /*1*/ fun remove(/*0*/ o: E): kotlin.Boolean public abstract override /*1*/ fun removeAll(/*0*/ c: kotlin.Collection): kotlin.Boolean public abstract override /*1*/ fun retainAll(/*0*/ c: kotlin.Collection): kotlin.Boolean } @@ -1255,9 +1255,8 @@ public final class ShortRange : kotlin.Range, kotlin.Progression, kotlin.CharSequence { /*primary*/ public constructor String() - public open override /*1*/ fun charAt(/*0*/ index: kotlin.Int): kotlin.Char public open override /*1*/ fun compareTo(/*0*/ other: kotlin.String): kotlin.Int - public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Char + public open override /*1*/ fun get(/*0*/ index: kotlin.Int): kotlin.Char public open override /*1*/ fun length(): kotlin.Int public final operator fun plus(/*0*/ other: kotlin.Any?): kotlin.String public open override /*1*/ fun subSequence(/*0*/ start: kotlin.Int, /*1*/ end: kotlin.Int): kotlin.CharSequence diff --git a/core/builtins/native/kotlin/CharSequence.kt b/core/builtins/native/kotlin/CharSequence.kt index e3ebc00c84f..93002c27ae7 100644 --- a/core/builtins/native/kotlin/CharSequence.kt +++ b/core/builtins/native/kotlin/CharSequence.kt @@ -28,7 +28,7 @@ public interface CharSequence { /** * Returns the character at the specified [index] in the sequence. */ - public fun charAt(index: Int): Char + public operator fun get(index: Int): Char /** * Returns a subsequence of this sequence. diff --git a/core/builtins/native/kotlin/Collections.kt b/core/builtins/native/kotlin/Collections.kt index b6fb655c4e3..2bd23ee8ec2 100644 --- a/core/builtins/native/kotlin/Collections.kt +++ b/core/builtins/native/kotlin/Collections.kt @@ -91,7 +91,7 @@ public interface MutableCollection : Collection, MutableIterable { * * @return `true` if the element has been successfully removed; `false` if it was not present in the collection. */ - public fun remove(o: Any?): Boolean + public fun remove(o: E): Boolean // Bulk Modification Operations /** @@ -181,7 +181,7 @@ public interface List : Collection { public interface MutableList : List, MutableCollection { // Modification Operations override fun add(e: E): Boolean - override fun remove(o: Any?): Boolean + override fun remove(o: E): Boolean // Bulk Modification Operations override fun addAll(c: Collection): Boolean @@ -214,7 +214,7 @@ public interface MutableList : List, MutableCollection { * * @return the element that has been removed. */ - public fun remove(index: Int): E + public fun removeAt(index: Int): E // List Iterators override fun listIterator(): MutableListIterator @@ -252,7 +252,7 @@ public interface MutableSet : Set, MutableCollection { // Modification Operations override fun add(e: E): Boolean - override fun remove(o: Any?): Boolean + override fun remove(o: E): Boolean // Bulk Modification Operations override fun addAll(c: Collection): Boolean diff --git a/core/builtins/native/kotlin/String.kt b/core/builtins/native/kotlin/String.kt index 5a8f939ab5d..eea83aaa82b 100644 --- a/core/builtins/native/kotlin/String.kt +++ b/core/builtins/native/kotlin/String.kt @@ -28,14 +28,9 @@ public class String : Comparable, CharSequence { */ public operator fun plus(other: Any?): String - /** - * Returns the character at the specified [index]. - */ - public operator fun get(index: Int): Char - public override fun length(): Int - public override fun charAt(index: Int): Char + public override fun get(index: Int): Char public override fun subSequence(start: Int, end: Int): CharSequence