diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt index a6b75629d38..2d0502ceec7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt @@ -142,7 +142,7 @@ public fun createByPattern(pattern: String, vararg args: .flatMap { it.value } .map { it.range } .filterNot { it.isEmpty() } - .sortedBy { -it.getStartOffset() } + .sortedByDescending { it.startOffset } // reformat whole text except for String arguments (as they can contain user's formatting to be preserved) if (stringPlaceholderRanges.none()) { diff --git a/j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt b/j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt index 06ba1fd008d..8202267e7bd 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt @@ -143,7 +143,7 @@ class OverloadReducer( private fun dropOverloadsForDefaultValues(equivalenceMap: Map) { val dropCandidates = equivalenceMap .map { it.key } - .sortedBy { -it.getParameterList().getParametersCount() } // we will try to drop them starting from ones with more parameters + .sortedByDescending { it.parameterList.parametersCount } // we will try to drop them starting from ones with more parameters DropCandidatesLoop@ for (method in dropCandidates) {