Cleanup: fix some compiler warnings (mostly deprecations, javaClass)
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.utils
|
||||
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.check
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.full.isSubclassOf
|
||||
@@ -106,8 +105,8 @@ private fun <T> tryCreateCallableMapping(callable: KCallable<*>, args: Iterator<
|
||||
}
|
||||
ArgsTraversalState.NAMED -> {
|
||||
assert(arg.name != null)
|
||||
val parIdx = unboundParams.indexOfFirst { it.name == arg.name }.check { it >= 0 }
|
||||
?: return null // failed to match: no matching named parameter found
|
||||
val parIdx = unboundParams.indexOfFirst { it.name == arg.name }.takeIf { it >= 0 }
|
||||
?: return null // failed to match: no matching named parameter found
|
||||
val par = unboundParams.removeAt(parIdx)
|
||||
val cvtRes = converter.tryConvertSingle(par, arg)
|
||||
if (cvtRes is ArgsConverter.Result.Success) {
|
||||
@@ -184,7 +183,7 @@ private class StringArgsConverter : ArgsConverter<String> {
|
||||
DoubleArray::class -> args.map { it?.toDoubleOrNull() }
|
||||
BooleanArray::class -> args.map { it?.toBoolean() }
|
||||
else -> null
|
||||
}?.toList()?.check { list -> list.none { it == null } }?.toTypedArray()
|
||||
}?.toList()?.takeIf { list -> list.none { it == null } }?.toTypedArray()
|
||||
|
||||
val parameterType = parameter.type
|
||||
if (parameterType.jvmErasure.java.isArray) {
|
||||
|
||||
Reference in New Issue
Block a user