Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd51141

Browse files
committed
Kotlin: Use variable names more consistently
1 parent 2f8ede2 commit dd51141

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ open class KotlinFileExtractor(
412412
}
413413

414414
// add method:
415-
val obinitLabel = getFunctionLabel(c, "<obinit>", listOf(), pluginContext.irBuiltIns.unitType, extensionReceiverParameter = null, functionTypeParameters = listOf(), classTypeArguments = listOf())
415+
val obinitLabel = getFunctionLabel(c, "<obinit>", listOf(), pluginContext.irBuiltIns.unitType, extensionReceiverParameter = null, functionTypeParameters = listOf(), classTypeArgsIncludingOuterClasses = listOf())
416416
val obinitId = tw.getLabelFor<DbMethod>(obinitLabel)
417417
val returnType = useType(pluginContext.irBuiltIns.unitType)
418418
tw.writeMethods(obinitId, "<obinit>", "<obinit>()", returnType.javaResult.id, returnType.kotlinResult.id, parentId, obinitId)
@@ -1561,7 +1561,7 @@ open class KotlinFileExtractor(
15611561
val id = tw.getFreshIdLabel<DbMethodaccess>()
15621562
val type = useType(e.type)
15631563
val locId = tw.getLocation(e)
1564-
val methodLabel = getFunctionLabel(irCallable.parent, "<obinit>", listOf(), e.type, null, functionTypeParameters = listOf(), classTypeArguments = listOf())
1564+
val methodLabel = getFunctionLabel(irCallable.parent, "<obinit>", listOf(), e.type, null, functionTypeParameters = listOf(), classTypeArgsIncludingOuterClasses = listOf())
15651565
val methodId = tw.getLabelFor<DbMethod>(methodLabel)
15661566
tw.writeExprs_methodaccess(id, type.javaResult.id, type.kotlinResult.id, exprParent.parent, exprParent.idx)
15671567
tw.writeHasLocation(id, locId)

java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ class X {
627627
else -> listOf()
628628
}
629629

630-
fun getFunctionLabel(f: IrFunction, classTypeArguments: List<IrTypeArgument>? = null) : String {
631-
return getFunctionLabel(f.parent, getFunctionShortName(f), f.valueParameters, f.returnType, f.extensionReceiverParameter, getFunctionTypeParameters(f), classTypeArguments)
630+
fun getFunctionLabel(f: IrFunction, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>? = null) : String {
631+
return getFunctionLabel(f.parent, getFunctionShortName(f), f.valueParameters, f.returnType, f.extensionReceiverParameter, getFunctionTypeParameters(f), classTypeArgsIncludingOuterClasses)
632632
}
633633

634634
fun getEnclosingClass(it: IrDeclarationParent): IrClass? =
@@ -645,10 +645,10 @@ class X {
645645
returnType: IrType,
646646
extensionReceiverParameter: IrValueParameter?,
647647
functionTypeParameters: List<IrTypeParameter>,
648-
classTypeArguments: List<IrTypeArgument>?
648+
classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?
649649
): String {
650-
val parentId = useDeclarationParent(parent, false, classTypeArguments, true)
651-
return getFunctionLabel(parent, parentId, name, parameters, returnType, extensionReceiverParameter, functionTypeParameters, classTypeArguments)
650+
val parentId = useDeclarationParent(parent, false, classTypeArgsIncludingOuterClasses, true)
651+
return getFunctionLabel(parent, parentId, name, parameters, returnType, extensionReceiverParameter, functionTypeParameters, classTypeArgsIncludingOuterClasses)
652652
}
653653

654654
fun getFunctionLabel(f: IrFunction, parentId: Label<out DbElement>, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?) =
@@ -751,13 +751,13 @@ class X {
751751
return id
752752
}
753753

754-
fun <T: DbCallable> useFunction(f: IrFunction, classTypeArguments: List<IrTypeArgument>? = null): Label<out T> {
754+
fun <T: DbCallable> useFunction(f: IrFunction, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>? = null): Label<out T> {
755755
if (f.isLocalFunction()) {
756756
val ids = getLocallyVisibleFunctionLabels(f)
757757
@Suppress("UNCHECKED_CAST")
758758
return ids.function as Label<out T>
759759
} else {
760-
return useFunctionCommon<T>(f, getFunctionLabel(f, classTypeArguments))
760+
return useFunctionCommon<T>(f, getFunctionLabel(f, classTypeArgsIncludingOuterClasses))
761761
}
762762
}
763763

0 commit comments

Comments
 (0)