Migrate deprecations in core, compiler, idea, tests
Replacing deprecated Char.toInt() with Char.code and Number.toChar() with Number.toInt().toChar(), where Number is not Int. KT-23451
This commit is contained in:
@@ -167,7 +167,7 @@ private fun String.offsetOf(position: CodePosition): Int {
|
||||
i++
|
||||
offsetInLine++
|
||||
|
||||
if (isEndOfLine(c.toInt())) {
|
||||
if (isEndOfLine(c.code)) {
|
||||
offsetInLine = 0
|
||||
lineCount++
|
||||
assert(lineCount <= position.line)
|
||||
|
||||
@@ -80,7 +80,7 @@ fun String.underlineAsText(from: Int, to: Int): String {
|
||||
marks.append(mark)
|
||||
lineWasMarked = lineWasMarked || mark != ' '
|
||||
|
||||
if (isEndOfLine(c.toInt())) {
|
||||
if (isEndOfLine(c.code)) {
|
||||
if (lineWasMarked) {
|
||||
lines.appendLine(marks.toString().trimEnd())
|
||||
lineWasMarked = false
|
||||
@@ -121,7 +121,7 @@ fun String.underlineAsHtml(from: Int, to: Int): String {
|
||||
|
||||
lines.append(mark)
|
||||
|
||||
if (isEndOfLine(c.toInt()) && openMarker) {
|
||||
if (isEndOfLine(c.code) && openMarker) {
|
||||
lines.append(underlineEnd + c + underlineStart)
|
||||
} else {
|
||||
lines.append(c)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION") // TODO: needs an intensive rework for new Char API
|
||||
package org.jetbrains.kotlin.js.parser.sourcemaps
|
||||
|
||||
import java.io.*
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION") // TODO: needs an intensive rework for new Char API
|
||||
package org.jetbrains.kotlin.js.parser.sourcemaps
|
||||
|
||||
import java.io.File
|
||||
|
||||
@@ -197,7 +197,7 @@ private constructor(private val whenExpression: KtWhenExpression, context: Trans
|
||||
is Int -> JsIntLiteral(it)
|
||||
is Short -> JsIntLiteral(it.toInt())
|
||||
is Byte -> JsIntLiteral(it.toInt())
|
||||
is Char -> JsIntLiteral(it.toInt())
|
||||
is Char -> JsIntLiteral(it.code)
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user