Fix "Should be replaced with Kotlin function" warnings

This commit is contained in:
Dmitry Gridin
2019-04-16 12:12:06 +07:00
parent d738a12b86
commit 3bed360c98
77 changed files with 161 additions and 99 deletions
@@ -202,7 +202,7 @@ object JavaToKotlinClassMap : PlatformToKotlinClassMap {
val kotlinMutableAnalogFqName = readOnlyToMutable[kotlinAnalog.fqNameUnsafe] ?: return setOf(kotlinAnalog)
return Arrays.asList(kotlinAnalog, builtIns.getBuiltInClassByFqName(kotlinMutableAnalogFqName))
return listOf(kotlinAnalog, builtIns.getBuiltInClassByFqName(kotlinMutableAnalogFqName))
}
override fun mapPlatformClass(classDescriptor: ClassDescriptor): Collection<ClassDescriptor> {
@@ -91,7 +91,7 @@ class CharValue(value: Char) : IntegerValueConstant<Char>(value) {
//TODO: KT-8507
12.toChar() -> "\\f"
'\r' -> "\\r"
else -> if (isPrintableUnicode(c)) Character.toString(c) else "?"
else -> if (isPrintableUnicode(c)) c.toString() else "?"
}
private fun isPrintableUnicode(c: Char): Boolean {
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.types.model.*
import org.jetbrains.kotlin.types.model.CaptureStatus
import org.jetbrains.kotlin.types.typeUtil.asTypeProjection
import org.jetbrains.kotlin.types.typeUtil.contains
import kotlin.math.max
interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext {
override fun TypeConstructorMarker.isDenotable(): Boolean {
@@ -470,7 +471,7 @@ private fun singleBestRepresentative(collection: Collection<KotlinType>) = colle
internal fun UnwrappedType.typeDepthInternal() =
when (this) {
is SimpleType -> typeDepthInternal()
is FlexibleType -> Math.max(lowerBound.typeDepthInternal(), upperBound.typeDepthInternal())
is FlexibleType -> max(lowerBound.typeDepthInternal(), upperBound.typeDepthInternal())
}
internal fun SimpleType.typeDepthInternal(): Int {