Code quality improvements

This commit is contained in:
Tamas Vajk
2022-10-03 14:03:16 +02:00
parent 90b28f04d8
commit a5172791ed
3 changed files with 1 additions and 20 deletions

View File

@@ -1914,13 +1914,6 @@ open class KotlinFileExtractor(
unaryopReceiver(id, c.dispatchReceiver, "Dispatch receiver")
}
/**
* Populate the lhs of a binary op from this call's extension receiver, and the rhs from its sole argument.
*/
fun binopExtensionMethod(id: Label<out DbExpr>) {
binopReceiver(id, c.extensionReceiver, "Extension receiver")
}
val dr = c.dispatchReceiver
when {
isFunction(target, "kotlin", "String", "plus", false) -> {

View File

@@ -1290,7 +1290,7 @@ open class KotlinUsesExtractor(
else null
} ?: run {
val parentFqName = parentClass.fqNameWhenAvailable?.asString()
val msg = "Couldn't find a Java equivalent function to $parentFqName.${f.name} in ${javaClass.fqNameWhenAvailable}"
val msg = "Couldn't find a Java equivalent function to $parentFqName.${f.name.asString()} in ${javaClass.fqNameWhenAvailable?.asString()}"
if (!globalExtensionState.deduplicatedWarnings.contains(msg)) {
logger.warn(msg)
globalExtensionState.deduplicatedWarnings.add(msg)

View File

@@ -12,15 +12,3 @@ inline fun <reified S: IrDeclaration> Iterable<IrDeclaration>.findSubType(
): S? {
return this.find { it is S && predicate(it) } as S?
}
/**
* This behaves the same as Iterable<IrDeclaration>.singleOrNull, but
* requires that the value found is of the subtype S, and it casts
* the result for you appropriately.
*/
inline fun <reified S: IrDeclaration> Iterable<IrDeclaration>.singleOrNullSubType(
predicate: (S) -> Boolean
): S? {
return this.singleOrNull { it is S && predicate(it) } as S?
}