From 3026456a39b77361ae5821e95ca2a6aee17b8688 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 28 Jun 2022 14:38:13 +0100 Subject: [PATCH] Kotlin: Make more methods private --- java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt | 4 ++-- .../src/main/kotlin/utils/TypeSubstitution.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt b/java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt index dce49790e0e..57a3e92e6b2 100644 --- a/java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt +++ b/java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt @@ -55,7 +55,7 @@ private val specialFunctions = mapOf( private val specialFunctionShortNames = specialFunctions.keys.map { it.functionName }.toSet() -fun getSpecialJvmName(f: IrFunction): String? { +private fun getSpecialJvmName(f: IrFunction): String? { if (specialFunctionShortNames.contains(f.name) && f is IrSimpleFunction) { f.allOverridden(true).forEach { overriddenFunc -> overriddenFunc.parentClassOrNull?.fqNameWhenAvailable?.let { parentFqName -> @@ -87,4 +87,4 @@ fun getJvmName(container: IrAnnotationContainer): String? { } } return (container as? IrFunction)?.let { getSpecialJvmName(container) } -} \ No newline at end of file +} diff --git a/java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt b/java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt index b249bb0091a..694b3dff289 100644 --- a/java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt +++ b/java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt @@ -37,7 +37,7 @@ fun IrType.substituteTypeArguments(params: List, arguments: Lis else -> this } -fun IrSimpleType.substituteTypeArguments(substitutionMap: Map): IrSimpleType { +private fun IrSimpleType.substituteTypeArguments(substitutionMap: Map): IrSimpleType { if (substitutionMap.isEmpty()) return this val newArguments = arguments.map { @@ -100,7 +100,7 @@ private fun subProjectedType(substitutionMap: Map context.irBuiltIns.anyNType is IrTypeProjection -> when(this.variance) { @@ -111,7 +111,7 @@ fun IrTypeArgument.upperBound(context: IrPluginContext) = else -> context.irBuiltIns.anyNType } -fun IrTypeArgument.lowerBound(context: IrPluginContext) = +private fun IrTypeArgument.lowerBound(context: IrPluginContext) = when(this) { is IrStarProjection -> context.irBuiltIns.nothingType is IrTypeProjection -> when(this.variance) { @@ -200,7 +200,7 @@ fun IrTypeArgument.withQuestionMark(b: Boolean): IrTypeArgument = typealias TypeSubstitution = (IrType, KotlinUsesExtractor.TypeContext, IrPluginContext) -> IrType -fun matchingTypeParameters(l: IrTypeParameter?, r: IrTypeParameter): Boolean { +private fun matchingTypeParameters(l: IrTypeParameter?, r: IrTypeParameter): Boolean { if (l === r) return true if (l == null)