Change String.subSequence parameter names to match those of CharSequence.subSequence.

This commit is contained in:
Ilya Gorbunov
2016-03-31 23:19:27 +03:00
parent c64b59ed82
commit f3f1aa8a15
3 changed files with 29 additions and 3 deletions
+1 -1
View File
@@ -654,7 +654,7 @@ public final class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequenc
public open override /*1*/ fun compareTo(/*0*/ other: kotlin.String): kotlin.Int
public open override /*1*/ fun get(/*0*/ index: kotlin.Int): kotlin.Char
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
public open override /*1*/ fun subSequence(/*0*/ startIndex: kotlin.Int, /*1*/ endIndex: kotlin.Int): kotlin.CharSequence
public companion object Companion {
/*primary*/ private constructor Companion()
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ public class String : Comparable<String>, CharSequence {
public override fun get(index: Int): Char
public override fun subSequence(start: Int, end: Int): CharSequence
public override fun subSequence(startIndex: Int, endIndex: Int): CharSequence
public override fun compareTo(other: String): Int
}
@@ -1,3 +1,19 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("StringsKt")
@@ -286,6 +302,16 @@ public fun String.substring(range: IntRange): String = substring(range.start, ra
*/
public fun CharSequence.subSequence(range: IntRange): CharSequence = subSequence(range.start, range.endInclusive + 1)
/**
* Returns a subsequence of this char sequence.
*
* This extension is chosen only for invocation with old-named parameters.
* Replace parameter names with the same as those of [CharSequence.subSequence].
*/
@kotlin.internal.InlineOnly
@Deprecated("Use parameters named startIndex and endIndex.", ReplaceWith("subSequence(startIndex = start, endIndex = end)"))
public inline fun String.subSequence(start: Int, end: Int): CharSequence = subSequence(start, end)
/**
* Returns a substring of chars from a range of this char sequence starting at the [startIndex] and ending right before the [endIndex].
*