From 00e56fd551ab19df6945a456060688888848ddf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Doln=C3=ADk?= Date: Mon, 2 Oct 2023 19:02:35 +0200 Subject: [PATCH] Reformat code. --- .../kotlin/co/touchlab/skie/kir/DescriptorProvider.kt | 8 ++++---- .../co/touchlab/skie/kir/NativeDescriptorProvider.kt | 4 ++-- .../skie/kir/irbuilder/impl/DeclarationBuilderImpl.kt | 4 ++-- .../skie/phases/apinotes/builder/ApiNotesFactory.kt | 2 +- .../delegate/BaseDefaultArgumentGeneratorDelegate.kt | 4 ++-- .../phases/features/enums/ExhaustiveEnumsGenerator.kt | 2 +- .../flow/FlowConversionConstructorsGenerator.kt | 1 - .../sealed/SealedFunctionGeneratorDelegate.kt | 8 ++++---- .../sealed/SealedGeneratorExtensionContainer.kt | 4 ++-- .../suspend/KotlinSuspendGeneratorDelegate.kt | 2 +- .../skie/phases/features/suspend/SuspendGenerator.kt | 3 ++- .../skie/phases/header/AddForwardDeclarationsPhase.kt | 3 ++- .../skie/phases/other/ExtraClassExportPhase.kt | 11 +++++++---- .../skie/phases/other/VerifyMinOSVersionPhase.kt | 4 ++-- .../skie/phases/swift/GenerateSirFileCodePhase.kt | 1 - .../skie/phases/swift/SwiftCacheSetupPhase.kt | 6 +++--- .../RenameTypesConflictingWithKotlinModulePhase.kt | 2 +- .../co/touchlab/skie/swiftmodel/SwiftModelProvider.kt | 9 ++++++--- .../skie/swiftmodel/factory/ObjCTypeProvider.kt | 2 +- .../factory/SwiftModelFactoryMembersDelegate.kt | 2 +- .../type/translation/SwiftTypeTranslator.kt | 4 ++-- 21 files changed, 46 insertions(+), 40 deletions(-) diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/DescriptorProvider.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/DescriptorProvider.kt index caa84c3a4..5c373e4ff 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/DescriptorProvider.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/DescriptorProvider.kt @@ -70,13 +70,13 @@ interface DescriptorProvider { fun DescriptorProvider.getAllExposedMembers(classDescriptor: ClassDescriptor): List = this.getExposedClassMembers(classDescriptor) + - this.getExposedCategoryMembers(classDescriptor) + - this.getExposedConstructors(classDescriptor) + this.getExposedCategoryMembers(classDescriptor) + + this.getExposedConstructors(classDescriptor) val DescriptorProvider.allExposedMembers: List get() = (this.exposedFiles.flatMap { this.getExposedStaticMembers(it) } + - this.exposedClasses.flatMap { this.getExposedClassMembers(it) + this.getExposedConstructors(it) }) + - this.exposedCategoryMembers + this.exposedClasses.flatMap { this.getExposedClassMembers(it) + this.getExposedConstructors(it) }) + + this.exposedCategoryMembers val DescriptorProvider.modulesWithExposedDeclarations: Set get() = (exposedClasses.map { it.module } + exposedFiles.map { getFileModule(it) }).toSet() diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/NativeDescriptorProvider.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/NativeDescriptorProvider.kt index d4315a98b..137b619d2 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/NativeDescriptorProvider.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/NativeDescriptorProvider.kt @@ -131,8 +131,8 @@ class NativeDescriptorProvider( @get:JvmName("isExposedExtension") private val CallableMemberDescriptor.isExposed: Boolean get() = this in exposedTopLevelMembers || - this in exposedCategoryMembers || - (this.containingDeclaration in exposedClasses && this.isExposable) + this in exposedCategoryMembers || + (this.containingDeclaration in exposedClasses && this.isExposable) fun registerExposedDescriptor(descriptor: DeclarationDescriptor) { when (descriptor) { diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/irbuilder/impl/DeclarationBuilderImpl.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/irbuilder/impl/DeclarationBuilderImpl.kt index cd1c35e7d..9b75adc39 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/irbuilder/impl/DeclarationBuilderImpl.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/kir/irbuilder/impl/DeclarationBuilderImpl.kt @@ -88,7 +88,7 @@ class DeclarationBuilderImpl( val sourceFile = existingMember.findSourceFileOrNull() val hasOriginalPackage = existingMember.findPackage() is DeserializedPackageFragment && - sourceFile in originalExposedFiles + sourceFile in originalExposedFiles return when { sourceFile == null -> getCustomNamespace(existingMember.findPackage().name.asStringStripSpecialMarkers()) @@ -173,7 +173,7 @@ class DeclarationBuilderImpl( private fun SymbolTable.allExposedTypeParameters(descriptorProvider: DescriptorProvider): List = (descriptorProvider.allExposedMembers.flatMap { referenceBoundTypeParameterContainer(it) } + - descriptorProvider.exposedClasses.flatMap { referenceBoundTypeParameterContainer(it) }) + descriptorProvider.exposedClasses.flatMap { referenceBoundTypeParameterContainer(it) }) .flatMap { it.typeParameters } private fun SymbolTable.referenceBoundTypeParameterContainer( diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/apinotes/builder/ApiNotesFactory.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/apinotes/builder/ApiNotesFactory.kt index 13241e642..2a8702e7b 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/apinotes/builder/ApiNotesFactory.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/apinotes/builder/ApiNotesFactory.kt @@ -25,7 +25,7 @@ object ApiNotesFactory { context(SirPhase.Context) private val DescriptorProvider.swiftModelsForClassesAndFiles: List get() = this.exposedClasses.filterNot { it.kind.isInterface }.map { it.swiftModel } + - this.exposedFiles.map { it.swiftModel } + this.exposedFiles.map { it.swiftModel } context(SirPhase.Context) private val DescriptorProvider.swiftModelsForInterfaces: List diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/defaultarguments/delegate/BaseDefaultArgumentGeneratorDelegate.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/defaultarguments/delegate/BaseDefaultArgumentGeneratorDelegate.kt index 54418f454..f420a2d2a 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/defaultarguments/delegate/BaseDefaultArgumentGeneratorDelegate.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/defaultarguments/delegate/BaseDefaultArgumentGeneratorDelegate.kt @@ -37,8 +37,8 @@ abstract class BaseDefaultArgumentGeneratorDelegate( context(SkiePhase.Context) protected val FunctionDescriptor.isInteropEnabled: Boolean get() = this.getConfiguration(DefaultArgumentInterop.Enabled) && - this.satisfiesMaximumDefaultArgumentCount && - (descriptorProvider.isFromLocalModule(this) || isInteropEnabledForExternalModules) + this.satisfiesMaximumDefaultArgumentCount && + (descriptorProvider.isFromLocalModule(this) || isInteropEnabledForExternalModules) context(SkiePhase.Context) private val FunctionDescriptor.satisfiesMaximumDefaultArgumentCount: Boolean diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/enums/ExhaustiveEnumsGenerator.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/enums/ExhaustiveEnumsGenerator.kt index 6545b6505..a7f451325 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/enums/ExhaustiveEnumsGenerator.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/enums/ExhaustiveEnumsGenerator.kt @@ -50,7 +50,7 @@ object ExhaustiveEnumsGenerator : SirPhase { context(SkiePhase.Context) private val KotlinClassSwiftModel.isSupported: Boolean get() = this.classDescriptor.kind.isEnumClass && - this.classDescriptor.isEnumInteropEnabled + this.classDescriptor.isEnumInteropEnabled context(SkiePhase.Context) private val ClassDescriptor.isEnumInteropEnabled: Boolean diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/flow/FlowConversionConstructorsGenerator.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/flow/FlowConversionConstructorsGenerator.kt index a9dcb758a..85f280b6a 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/flow/FlowConversionConstructorsGenerator.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/flow/FlowConversionConstructorsGenerator.kt @@ -13,7 +13,6 @@ import co.touchlab.skie.sir.element.toTypeParameterUsage import co.touchlab.skie.sir.type.SirType import co.touchlab.skie.sir.type.TypeParameterUsageSirType import co.touchlab.skie.swiftmodel.SwiftModelScope -import io.outfoxx.swiftpoet.Modifier object FlowConversionConstructorsGenerator : SirPhase { diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/sealed/SealedFunctionGeneratorDelegate.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/sealed/SealedFunctionGeneratorDelegate.kt index 1de67db4c..f9fd2fcb3 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/sealed/SealedFunctionGeneratorDelegate.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/sealed/SealedFunctionGeneratorDelegate.kt @@ -122,10 +122,10 @@ class SealedFunctionGeneratorDelegate( } else { add( "fatalError(" + - "\"Unknown subtype. " + - "This error should not happen under normal circumstances " + - "since ${swiftModel.primarySirClass} is sealed." + - "\")\n", + "\"Unknown subtype. " + + "This error should not happen under normal circumstances " + + "since ${swiftModel.primarySirClass} is sealed." + + "\")\n", ) } diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/sealed/SealedGeneratorExtensionContainer.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/sealed/SealedGeneratorExtensionContainer.kt index 78f9fbe52..2bf36ba9e 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/sealed/SealedGeneratorExtensionContainer.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/sealed/SealedGeneratorExtensionContainer.kt @@ -50,8 +50,8 @@ interface SealedGeneratorExtensionContainer { val KotlinClassSwiftModel.hasElseCase: Boolean get() = this.hasUnexposedSealedSubclasses || - this.exposedSealedSubclasses.size != this.visibleSealedSubclasses.size || - this.visibleSealedSubclasses.isEmpty() + this.exposedSealedSubclasses.size != this.visibleSealedSubclasses.size || + this.visibleSealedSubclasses.isEmpty() val KotlinClassSwiftModel.visibleSealedSubclasses: List get() = this.exposedSealedSubclasses.filter { configurationProvider.getConfiguration(it, SealedInterop.Case.Visible) } diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/suspend/KotlinSuspendGeneratorDelegate.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/suspend/KotlinSuspendGeneratorDelegate.kt index 8ae099777..051a1003c 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/suspend/KotlinSuspendGeneratorDelegate.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/suspend/KotlinSuspendGeneratorDelegate.kt @@ -155,7 +155,7 @@ class KotlinSuspendGeneratorDelegate( private fun ValueParameterDescriptor.configureExtensionReceiverFlowMapping(originalFunctionDescriptor: FunctionDescriptor) { context.doInPhase(SuspendGenerator.KotlinBridgeConfigurationPhase) { val isExtensionReceiverUsedAsSwiftReceiver = originalFunctionDescriptor.swiftModel.scope.isMember && - originalFunctionDescriptor.dispatchReceiverParameter == null + originalFunctionDescriptor.dispatchReceiverParameter == null if (isExtensionReceiverUsedAsSwiftReceiver) { this@configureExtensionReceiverFlowMapping.swiftModel.flowMappingStrategy = FlowMappingStrategy.TypeArgumentsOnly diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/suspend/SuspendGenerator.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/suspend/SuspendGenerator.kt index ef849dafc..1d2531207 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/suspend/SuspendGenerator.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/features/suspend/SuspendGenerator.kt @@ -19,7 +19,8 @@ object SuspendGenerator : DescriptorModificationPhase { context(DescriptorModificationPhase.Context) override fun isActive(): Boolean = isEnabled() - private fun SkiePhase.Context.isEnabled(): Boolean = SkieConfigurationFlag.Feature_CoroutinesInterop in skieConfiguration.enabledConfigurationFlags + private fun SkiePhase.Context.isEnabled(): Boolean = + SkieConfigurationFlag.Feature_CoroutinesInterop in skieConfiguration.enabledConfigurationFlags context(DescriptorModificationPhase.Context) override fun execute() { diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/header/AddForwardDeclarationsPhase.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/header/AddForwardDeclarationsPhase.kt index d5ab80426..e14f6ebdf 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/header/AddForwardDeclarationsPhase.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/header/AddForwardDeclarationsPhase.kt @@ -45,7 +45,8 @@ class AddForwardDeclarationsPhase( val knownDeclarations = forwardDeclarations + definedDeclarations val missingExternalReferencedDeclarations = referencedDeclarations.filterNotIn(knownDeclarations) - val definedDeclarationsWithoutForwardDeclaration = definedDeclarations.filter { it.name !in forwardDeclarationsNames }.map { it.toString() } + val definedDeclarationsWithoutForwardDeclaration = + definedDeclarations.filter { it.name !in forwardDeclarationsNames }.map { it.toString() } return missingExternalReferencedDeclarations + definedDeclarationsWithoutForwardDeclaration } diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/other/ExtraClassExportPhase.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/other/ExtraClassExportPhase.kt index 5bc3d719d..1133ecd65 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/other/ExtraClassExportPhase.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/other/ExtraClassExportPhase.kt @@ -66,7 +66,7 @@ class ExtraClassExportPhase( } val allFlowArguments = descriptorProvider.allExposedMembers.flatMap { it.getAllFlowArgumentClasses() } + - descriptorProvider.exposedClasses.flatMap { it.getAllFlowArgumentClasses() } + descriptorProvider.exposedClasses.flatMap { it.getAllFlowArgumentClasses() } val allExposableFlowArguments = allFlowArguments.filter { descriptorProvider.isExposable(it) } @@ -136,9 +136,12 @@ private fun ClassDescriptor.getAllFlowArgumentClasses(): List = private fun CallableMemberDescriptor.getAllFlowArgumentClasses(): List = typeParameters.flatMap { it.getAllFlowArgumentClasses() } + - valueParameters.flatMap { it.type.getAllFlowArgumentClasses() } + - (returnType?.getAllFlowArgumentClasses() ?: emptyList()) + - (contextReceiverParameters + listOfNotNull(dispatchReceiverParameter, extensionReceiverParameter)).flatMap { it.getAllFlowArgumentClasses() } + valueParameters.flatMap { it.type.getAllFlowArgumentClasses() } + + (returnType?.getAllFlowArgumentClasses() ?: emptyList()) + + (contextReceiverParameters + listOfNotNull( + dispatchReceiverParameter, + extensionReceiverParameter + )).flatMap { it.getAllFlowArgumentClasses() } // Sacrifices some completeness for simplicity - otherwise it would have to check all usages of the type parameter. private fun TypeParameterDescriptor.getAllFlowArgumentClasses(): List = diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/other/VerifyMinOSVersionPhase.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/other/VerifyMinOSVersionPhase.kt index b889f5ba1..ef7329ab6 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/other/VerifyMinOSVersionPhase.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/other/VerifyMinOSVersionPhase.kt @@ -22,8 +22,8 @@ object VerifyMinOSVersionPhase : ClassExportPhase { if (currentMinVersion.isLowerVersionThan(minRequiredVersion)) { error( "Minimum OS version for ${configurables.target.name} must be at least $minRequiredVersion to support Swift Async. " + - "However, the configured minimum OS version is only $currentMinVersion. " + - "This is most likely a bug in SKIE Gradle plugin which should have set the minimum required version automatically.", + "However, the configured minimum OS version is only $currentMinVersion. " + + "This is most likely a bug in SKIE Gradle plugin which should have set the minimum required version automatically.", ) } } diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/swift/GenerateSirFileCodePhase.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/swift/GenerateSirFileCodePhase.kt index ab2b3d818..4f1a0bb45 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/swift/GenerateSirFileCodePhase.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/swift/GenerateSirFileCodePhase.kt @@ -374,7 +374,6 @@ private val SirDeclaration.defaultVisibility: SirVisibility private val SirOverridableDeclaration<*>.needsOverride: Boolean get() = overriddenDeclarations.any { it.memberOwner?.kind == SirClass.Kind.Class } - private fun T.applyIf(condition: Boolean, action: T.() -> Unit): T = this.apply { if (condition) { diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/swift/SwiftCacheSetupPhase.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/swift/SwiftCacheSetupPhase.kt index 15e01a4c1..0b2f1739a 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/swift/SwiftCacheSetupPhase.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/swift/SwiftCacheSetupPhase.kt @@ -24,9 +24,9 @@ object SwiftCacheSetupPhase : SirPhase { // Must use `or` to prevent short circuit optimization. return framework.kotlinHeader.copyFileToIfDifferent(dummyFramework.kotlinHeader) or - framework.modulemapFile.copyFileToIfDifferent(dummyFramework.modulemapFile) or - skieBuildDirectory.swiftCompiler.apiNotes.apiNotes(framework.moduleName) - .copyFileToIfDifferent(dummyFramework.apiNotes) + framework.modulemapFile.copyFileToIfDifferent(dummyFramework.modulemapFile) or + skieBuildDirectory.swiftCompiler.apiNotes.apiNotes(framework.moduleName) + .copyFileToIfDifferent(dummyFramework.apiNotes) } // Solves a bug in Swift compiler. diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/typeconflicts/RenameTypesConflictingWithKotlinModulePhase.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/typeconflicts/RenameTypesConflictingWithKotlinModulePhase.kt index 0ab175348..0eef2967c 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/typeconflicts/RenameTypesConflictingWithKotlinModulePhase.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/phases/typeconflicts/RenameTypesConflictingWithKotlinModulePhase.kt @@ -26,7 +26,7 @@ object RenameTypesConflictingWithKotlinModulePhase : SirPhase { private fun logModuleNameCollisionWarning(moduleName: String) { reporter.warning( "Type '$moduleName' was renamed to '${moduleName}_' " + - "because it has the same name as the produced framework which is forbidden.", + "because it has the same name as the produced framework which is forbidden.", ) } } diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/SwiftModelProvider.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/SwiftModelProvider.kt index 3dd532398..43a768dc3 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/SwiftModelProvider.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/SwiftModelProvider.kt @@ -163,7 +163,10 @@ class SwiftModelProvider( translator.mapReferenceType( this.defaultType, // TODO ?: SwiftGenericExportScope.None is a hack that relies on the fact that none of the types with SwiftModel can inherit from a special type that is generic - SwiftExportScope(this.swiftModelOrNull?.swiftGenericExportScope ?: SwiftGenericExportScope.None, SwiftExportScope.Flags.ReferenceType), + SwiftExportScope( + this.swiftModelOrNull?.swiftGenericExportScope ?: SwiftGenericExportScope.None, + SwiftExportScope.Flags.ReferenceType + ), FlowMappingStrategy.TypeArgumentsOnly, ) @@ -241,8 +244,8 @@ class SwiftModelProvider( private fun DeclarationDescriptor.throwUnknownDescriptor(): Nothing { throw IllegalArgumentException( "Cannot find SwiftModel for descriptor: $this. Possible reasons: " + - "Descriptor is not exposed and therefore does not have a SwiftModel. " + - "Or it is exposed but as another type (for example as ConvertedProperty instead of a RegularProperty).", + "Descriptor is not exposed and therefore does not have a SwiftModel. " + + "Or it is exposed but as another type (for example as ConvertedProperty instead of a RegularProperty).", ) } diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/factory/ObjCTypeProvider.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/factory/ObjCTypeProvider.kt index 996de59fa..e31afa745 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/factory/ObjCTypeProvider.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/factory/ObjCTypeProvider.kt @@ -136,7 +136,7 @@ class ObjCTypeProvider( if (!returnBridge.successMayBeZero) { check( successReturnType is ObjCNonNullReferenceType - || (successReturnType is ObjCPointerType && !successReturnType.nullable), + || (successReturnType is ObjCPointerType && !successReturnType.nullable), ) { "Unexpected return type: $successReturnType in $method" } diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/factory/SwiftModelFactoryMembersDelegate.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/factory/SwiftModelFactoryMembersDelegate.kt index 5e5cb6896..f89d43954 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/factory/SwiftModelFactoryMembersDelegate.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/factory/SwiftModelFactoryMembersDelegate.kt @@ -156,7 +156,7 @@ class SwiftModelFactoryMembersDelegate( group: List, ): Map = createBoundedConvertedPropertiesEnclosingModels(group) + - createBoundedConvertedPropertiesFunctions(group) + createBoundedConvertedPropertiesFunctions(group) private fun createBoundedConvertedPropertiesEnclosingModels( group: List, diff --git a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/type/translation/SwiftTypeTranslator.kt b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/type/translation/SwiftTypeTranslator.kt index 763f15ab1..378850437 100644 --- a/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/type/translation/SwiftTypeTranslator.kt +++ b/SKIE/compiler/kotlin-plugin/src/kgp_common/kotlin/co/touchlab/skie/swiftmodel/type/translation/SwiftTypeTranslator.kt @@ -150,7 +150,7 @@ class SwiftTypeTranslator( reporter.warning( "Exposed type '$kotlinType' is '$firstType' and '$secondType' at the same time. " + - "This most likely wouldn't work as expected.", + "This most likely wouldn't work as expected.", ) } @@ -300,7 +300,7 @@ class SwiftTypeTranslator( } val parameterTypes = listOfNotNull(functionType.getReceiverTypeFromFunctionType()) + - functionType.getValueParameterTypesFromFunctionType().map { it.type } + functionType.getValueParameterTypesFromFunctionType().map { it.type } return LambdaSirType( if (returnsVoid) {