diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/AbstractCInteropCommonizerTask.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/AbstractCInteropCommonizerTask.kt index 8b63c567435..7b8d4945a7d 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/AbstractCInteropCommonizerTask.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/AbstractCInteropCommonizerTask.kt @@ -32,7 +32,7 @@ internal abstract class AbstractCInteropCommonizerTask : DefaultTask() { val fileProvider = project.filesProvider { val parameters = getCommonizationParameters(compilation) ?: return@filesProvider emptySet() CommonizerOutputFileLayout - .getCommonizedDirectory(outputDirectory(parameters), compilationCommonizerTarget) + .resolveCommonizedDirectory(outputDirectory(parameters), compilationCommonizerTarget) .listFiles().orEmpty().toSet() } diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/HierarchicalKotlinNativePlatformDependencies.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/HierarchicalKotlinNativePlatformDependencies.kt index 35d1b79642b..07a4319e12c 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/HierarchicalKotlinNativePlatformDependencies.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/HierarchicalKotlinNativePlatformDependencies.kt @@ -39,7 +39,7 @@ private fun Project.getOriginalPlatformLibrariesFor(target: LeafCommonizerTarget } private fun HierarchicalNativeDistributionCommonizerTask.getCommonizedPlatformLibrariesFor(target: SharedCommonizerTarget): FileCollection { - val targetOutputDirectory = CommonizerOutputFileLayout.getCommonizedDirectory(getRootOutputDirectory(), target) + val targetOutputDirectory = CommonizerOutputFileLayout.resolveCommonizedDirectory(getRootOutputDirectory(), target) return project.filesProvider { targetOutputDirectory.listFiles().orEmpty().toList() }.builtBy(this) } diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/HierarchicalNativeDistributionCommonizerTask.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/HierarchicalNativeDistributionCommonizerTask.kt index 46499c81029..01596ef3329 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/HierarchicalNativeDistributionCommonizerTask.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/HierarchicalNativeDistributionCommonizerTask.kt @@ -90,8 +90,7 @@ internal open class HierarchicalNativeDistributionCommonizerTask : DefaultTask() @TaskAction protected fun run() { - getRootOutputDirectory().deleteRecursively() // TODO NOW CACHING! - GradleCliCommonizer(project).commonizeNativeDistribution( + NativeDistributionCommonizationCache(project, GradleCliCommonizer(project)).commonizeNativeDistribution( konanHome = konanHome, outputDirectory = getRootOutputDirectory(), outputTargets = project.getAllCommonizerTargets(), @@ -106,7 +105,7 @@ internal open class HierarchicalNativeDistributionCommonizerTask : DefaultTask() private fun Project.getAllCommonizerTargets(): Set { return allprojects.flatMapTo(mutableSetOf()) { project -> - val kotlin = project.extensions.findByName("kotlin") // TODO COMMONIZER FAILS HARD WHEN NOTHING IS DEFINED + val kotlin = project.extensions.findByName("kotlin") ?.let { it as KotlinProjectExtension } ?.let { it as? KotlinMultiplatformExtension } ?: return@flatMapTo emptySet() diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/NativeDistributionCommonizationCache.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/NativeDistributionCommonizationCache.kt index 65041200e5e..b5b17cfcfe8 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/NativeDistributionCommonizationCache.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/NativeDistributionCommonizationCache.kt @@ -3,61 +3,80 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:Suppress("SameParameterValue") + package org.jetbrains.kotlin.gradle.targets.native.internal import org.gradle.api.Project -import org.jetbrains.kotlin.compilerRunner.KotlinToolRunner +import org.jetbrains.kotlin.commonizer.* +import org.jetbrains.kotlin.commonizer.CommonizerOutputFileLayout.resolveCommonizedDirectory import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider import java.io.File -// TODO NOW: Support! internal val Project.isNativeDistributionCommonizationCacheEnabled: Boolean get() = PropertiesProvider(this).enableNativeDistributionCommonizationCache internal class NativeDistributionCommonizationCache( - private val runner: KotlinToolRunner, - private val outputDirectory: File -) { - private val successMarker = outputDirectory.resolve(".commonized") + private val project: Project, + private val commonizer: NativeDistributionCommonizer +) : NativeDistributionCommonizer { - fun runIfNecessary(args: List) { - if (!isCached(args)) { - run(args) - } - } - - private fun isCached(args: List): Boolean { - if (!runner.project.isNativeDistributionCommonizationCacheEnabled) { + override fun commonizeNativeDistribution( + konanHome: File, + outputDirectory: File, + outputTargets: Set, + logLevel: CommonizerLogLevel + ) { + if (!project.isNativeDistributionCommonizationCacheEnabled) { logInfo("Cache disabled") - return false + return commonizer.commonizeNativeDistribution(konanHome, outputDirectory, outputTargets, logLevel) } - if (successMarker.exists() && successMarker.isFile) { - if (successMarker.readText() == successMarkerText(args)) { - logInfo("Cache hit for ${outputDirectory.path}") - return true - } else { - logQuiet("Cache miss. Different arguments for ${outputDirectory.path}") - successMarker.delete() - } + val cachedOutputTargets = outputTargets + .filter { outputTarget -> isCached(resolveCommonizedDirectory(outputDirectory, outputTarget)) } + .onEach { outputTarget -> logInfo("Cache hit: $outputTarget already commonized") } + .toSet() + + val missingOutputTargets = outputTargets - cachedOutputTargets + + if (canReturnFast(konanHome, missingOutputTargets)) { + logInfo("All available targets are commonized already - Nothing to do") + return } - return false + missingOutputTargets + .map { outputTarget -> resolveCommonizedDirectory(outputDirectory, outputTarget) } + .forEach { commonizedDirectory -> if (commonizedDirectory.exists()) commonizedDirectory.deleteRecursively() } + + commonizer.commonizeNativeDistribution( + konanHome, outputDirectory, missingOutputTargets, logLevel + ) + + missingOutputTargets + .map { outputTarget -> resolveCommonizedDirectory(outputDirectory, outputTarget) } + .filter { commonizedDirectory -> commonizedDirectory.isDirectory } + .forEach { commonizedDirectory -> commonizedDirectory.resolve(".success").isFile } } - private fun run(args: List) { - outputDirectory.deleteRecursively() - runner.run(args) - successMarker.writeText(successMarkerText(args)) + private fun isCached(directory: File): Boolean { + val successMarkerFile = directory.resolve(".success") + return successMarkerFile.isFile } - private fun successMarkerText(args: List): String { - return args.joinToString("\n") + private fun canReturnFast( + konanHome: File, missingOutputTargets: Set + ): Boolean { + if (missingOutputTargets.isEmpty()) return true + + // If all platform lib dirs are missing, we can also return fast from the cache without invoking + // the commonizer + return missingOutputTargets.allLeaves() + .map { target -> target.konanTarget } + .map { konanTarget -> KonanDistribution(konanHome).platformLibsDir.resolve(konanTarget.name) } + .none { platformLibsDir -> platformLibsDir.exists() } } - private fun logInfo(message: String) = runner.project.logger.info("${Logging.prefix}: $message") - - private fun logQuiet(message: String) = runner.project.logger.quiet("${Logging.prefix}: $message") + private fun logInfo(message: String) = project.logger.info("${Logging.prefix}: $message") private object Logging { const val prefix = "Native Distribution Commonization" diff --git a/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/CliCommonizer.kt b/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/CliCommonizer.kt index b8df9a86d2f..662ec2fc943 100644 --- a/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/CliCommonizer.kt +++ b/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/CliCommonizer.kt @@ -16,8 +16,7 @@ public fun CliCommonizer(classLoader: ClassLoader): CliCommonizer { return CliCommonizer(CommonizerClassLoaderExecutor(classLoader)) } -public class CliCommonizer(private val executor: Executor) : Commonizer { - +public class CliCommonizer(private val executor: Executor) : NativeDistributionCommonizer, CInteropCommonizer { public fun interface Executor { public operator fun invoke(arguments: List) } diff --git a/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/Commonizer.kt b/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/Commonizer.kt index f9621adf407..2d487e5c424 100644 --- a/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/Commonizer.kt +++ b/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/Commonizer.kt @@ -8,8 +8,7 @@ package org.jetbrains.kotlin.commonizer import java.io.File import java.io.Serializable -public interface Commonizer : Serializable { - +public interface CInteropCommonizer : Serializable { @Throws(Throwable::class) public fun commonizeLibraries( konanHome: File, @@ -19,7 +18,9 @@ public interface Commonizer : Serializable { outputDirectory: File, logLevel: CommonizerLogLevel = CommonizerLogLevel.Quiet ) +} +public interface NativeDistributionCommonizer : Serializable { @Throws(Throwable::class) public fun commonizeNativeDistribution( konanHome: File, @@ -27,4 +28,4 @@ public interface Commonizer : Serializable { outputTargets: Set, logLevel: CommonizerLogLevel = CommonizerLogLevel.Quiet ) -} +} \ No newline at end of file diff --git a/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/TargetLibrariesLayout.kt b/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/TargetLibrariesLayout.kt index 7b475fe5994..f2dedfaefdf 100644 --- a/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/TargetLibrariesLayout.kt +++ b/native/commonizer-api/src/org/jetbrains/kotlin/commonizer/TargetLibrariesLayout.kt @@ -12,7 +12,7 @@ import java.util.* public object CommonizerOutputFileLayout { internal const val maxFileNameLength = 150 - public fun getCommonizedDirectory(root: File, target: CommonizerTarget): File { + public fun resolveCommonizedDirectory(root: File, target: CommonizerTarget): File { return root.resolve(target.fileName) } diff --git a/native/commonizer-api/test/org/jetbrains/kotlin/commonizer/CommonizeNativeDistributionTest.kt b/native/commonizer-api/test/org/jetbrains/kotlin/commonizer/CommonizeNativeDistributionTest.kt index f7a10006661..7708db79f51 100644 --- a/native/commonizer-api/test/org/jetbrains/kotlin/commonizer/CommonizeNativeDistributionTest.kt +++ b/native/commonizer-api/test/org/jetbrains/kotlin/commonizer/CommonizeNativeDistributionTest.kt @@ -5,7 +5,7 @@ package org.jetbrains.kotlin.commonizer -import org.jetbrains.kotlin.commonizer.CommonizerOutputFileLayout.getCommonizedDirectory +import org.jetbrains.kotlin.commonizer.CommonizerOutputFileLayout.resolveCommonizedDirectory import org.jetbrains.kotlin.commonizer.utils.konanHome import org.jetbrains.kotlin.konan.target.KonanTarget.* import org.junit.Rule @@ -20,7 +20,7 @@ class CommonizeNativeDistributionTest { val temporaryOutputDirectory = TemporaryFolder() @Test - fun commonizeLinuxPlatforms() { + fun `commonize - linux platforms`() { val linuxTarget1 = CommonizerTarget(LINUX_X64, LINUX_ARM64) val linuxTarget2 = CommonizerTarget(LINUX_X64, LINUX_ARM64, LINUX_ARM32_HFP) @@ -32,13 +32,23 @@ class CommonizeNativeDistributionTest { ) assertTrue( - getCommonizedDirectory(temporaryOutputDirectory.root, linuxTarget1).isDirectory, + resolveCommonizedDirectory(temporaryOutputDirectory.root, linuxTarget1).isDirectory, "Expected directory for $linuxTarget1" ) assertTrue( - getCommonizedDirectory(temporaryOutputDirectory.root, linuxTarget2).isDirectory, + resolveCommonizedDirectory(temporaryOutputDirectory.root, linuxTarget2).isDirectory, "Expected directory for $linuxTarget2" ) } + + @Test + fun `commonize - no outputTargets specified`() { + CliCommonizer(this::class.java.classLoader).commonizeNativeDistribution( + konanHome = konanHome, + outputTargets = emptySet(), + outputDirectory = temporaryOutputDirectory.root, + logLevel = CommonizerLogLevel.Info + ) + } } \ No newline at end of file diff --git a/native/commonizer/src/org/jetbrains/kotlin/commonizer/cli/OutputCommonizerTargetsOptionType.kt b/native/commonizer/src/org/jetbrains/kotlin/commonizer/cli/OutputCommonizerTargetsOptionType.kt index 77044b89cd1..7c9dcbdfec0 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/commonizer/cli/OutputCommonizerTargetsOptionType.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/commonizer/cli/OutputCommonizerTargetsOptionType.kt @@ -10,14 +10,19 @@ import org.jetbrains.kotlin.commonizer.parseCommonizerTarget internal object OutputCommonizerTargetsOptionType : OptionType>( alias = "output-targets", - description = "Shared commonizer target representing the commonized output hierarchy", // TODO NOW + description = "All output targets separated with ';'", mandatory = true ) { override fun parse(rawValue: String, onError: (reason: String) -> Nothing): Option> { return try { - Option(this, rawValue.split(";").map(::parseCommonizerTarget).map { it as SharedCommonizerTarget }.toSet()) + Option( + this, rawValue.split(";") + .map { it.trim() }.filter { it.isNotEmpty() } + .map(::parseCommonizerTarget) + .map { it as SharedCommonizerTarget }.toSet() + ) } catch (t: Throwable) { - onError("Failed parsing output-target ($rawValue): ${t.message}") + onError("Failed parsing output-targets ($rawValue): ${t.message}") } } } diff --git a/native/commonizer/src/org/jetbrains/kotlin/commonizer/cli/OutputOptionType.kt b/native/commonizer/src/org/jetbrains/kotlin/commonizer/cli/OutputOptionType.kt index 86a1e9822bd..c4f50923272 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/commonizer/cli/OutputOptionType.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/commonizer/cli/OutputOptionType.kt @@ -13,7 +13,7 @@ internal object OutputOptionType : OptionType("output-path", "Destination try { val valid = when { - file.isDirectory -> file.listFiles()?.isEmpty() != false + file.isDirectory -> true file.exists() -> false else -> { if (!file.mkdirs()) onError("Destination can't be created: $rawValue") diff --git a/native/commonizer/src/org/jetbrains/kotlin/commonizer/konan/LibraryCommonizer.kt b/native/commonizer/src/org/jetbrains/kotlin/commonizer/konan/LibraryCommonizer.kt index f000b9dff8f..102ccc386ae 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/commonizer/konan/LibraryCommonizer.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/commonizer/konan/LibraryCommonizer.kt @@ -90,11 +90,11 @@ internal class LibraryCommonizer internal constructor( } private fun checkPreconditions() { - /* TODO - when (outputTarget.allLeaves().size) { - 0 -> progressLogger.fatal("No targets specified") - 1 -> progressLogger.fatal("Too few targets specified: $outputTarget") + outputTargets.forEach { outputTarget -> + when (outputTarget.allLeaves().size) { + 0 -> logger.fatal("No targets specified") + 1 -> logger.fatal("Too few targets specified: $outputTarget") + } } - */ } } diff --git a/native/commonizer/src/org/jetbrains/kotlin/commonizer/konan/ModuleSerializer.kt b/native/commonizer/src/org/jetbrains/kotlin/commonizer/konan/ModuleSerializer.kt index d54502fa37f..7cb3af683ff 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/commonizer/konan/ModuleSerializer.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/commonizer/konan/ModuleSerializer.kt @@ -20,7 +20,7 @@ internal class ModuleSerializer( private val destination: File, ) : ResultsConsumer { override fun consume(parameters: CommonizerParameters, target: CommonizerTarget, moduleResult: ResultsConsumer.ModuleResult) { - val librariesDestination = CommonizerOutputFileLayout.getCommonizedDirectory(destination, target) + val librariesDestination = CommonizerOutputFileLayout.resolveCommonizedDirectory(destination, target) when (moduleResult) { is ResultsConsumer.ModuleResult.Commonized -> { val libraryDestination = librariesDestination.resolve(moduleResult.fileSystemCompatibleLibraryName) diff --git a/native/commonizer/testData/callableMemberCommonization/extensionReceivers/commonized/js/package_root.kt b/native/commonizer/testData/callableMemberCommonization/extensionReceivers/commonized/js/package_root.kt deleted file mode 100644 index 2172b933838..00000000000 --- a/native/commonizer/testData/callableMemberCommonization/extensionReceivers/commonized/js/package_root.kt +++ /dev/null @@ -1,36 +0,0 @@ -actual class Planet actual constructor(actual val name: String, actual val diameter: Double) - -actual val intProperty get() = 42 -actual val Int.intProperty get() = this -actual val Short.intProperty get() = toInt() -actual val Long.intProperty get() = toInt() -actual val String.intProperty get() = length -actual val Planet.intProperty get() = diameter.toInt() - -actual fun intFunction() = 42 -actual fun Int.intFunction() = this -actual fun Short.intFunction() = toInt() -actual fun Long.intFunction() = toInt() -actual fun String.intFunction() = length -actual fun Planet.intFunction() = diameter.toInt() - -val String.mismatchedProperty1 get() = 42 -val mismatchedProperty2 get() = 42 - -fun String.mismatchedFunction1() = 42 -fun mismatchedFunction2() = 42 - -actual val T.propertyWithTypeParameter1 get() = 42 -actual val T.propertyWithTypeParameter2 get() = 42 -val T.propertyWithTypeParameter3 get() = 42 -actual val T.propertyWithTypeParameter4 get() = length -val T.propertyWithTypeParameter5: Int get() = length -val T.propertyWithTypeParameter6: Int get() = length -val T.propertyWithTypeParameter7: Int get() = length -val T.propertyWithTypeParameter8 get() = 42 -val T.propertyWithTypeParameter9 get() = 42 - -actual fun T.functionWithTypeParameter1() {} -fun T.functionWithTypeParameter2() {} -fun T.functionWithTypeParameter3() {} -fun T.functionWithTypeParameter4() {} diff --git a/native/commonizer/testData/callableMemberCommonization/extensionReceivers/commonized/jvm/package_root.kt b/native/commonizer/testData/callableMemberCommonization/extensionReceivers/commonized/jvm/package_root.kt deleted file mode 100644 index f6a39280c23..00000000000 --- a/native/commonizer/testData/callableMemberCommonization/extensionReceivers/commonized/jvm/package_root.kt +++ /dev/null @@ -1,36 +0,0 @@ -actual class Planet actual constructor(actual val name: String, actual val diameter: Double) - -actual val intProperty get() = 42 -actual val Int.intProperty get() = this -actual val Short.intProperty get() = toInt() -actual val Long.intProperty get() = toInt() -actual val String.intProperty get() = length -actual val Planet.intProperty get() = diameter.toInt() - -actual fun intFunction() = 42 -actual fun Int.intFunction() = this -actual fun Short.intFunction() = toInt() -actual fun Long.intFunction() = toInt() -actual fun String.intFunction() = length -actual fun Planet.intFunction() = diameter.toInt() - -val mismatchedProperty1 get() = 42 -val Double.mismatchedProperty2 get() = 42 - -fun mismatchedFunction1() = 42 -fun Double.mismatchedFunction2() = 42 - -actual val T.propertyWithTypeParameter1 get() = 42 -actual val T.propertyWithTypeParameter2 get() = 42 -val T.propertyWithTypeParameter3 get() = 42 -actual val T.propertyWithTypeParameter4 get() = length -val T.propertyWithTypeParameter5: Int get() = length -val T.propertyWithTypeParameter6: Int get() = length -val String.propertyWithTypeParameter7: Int get() = length -val Q.propertyWithTypeParameter8 get() = 42 -val T.propertyWithTypeParameter9 get() = 42 - -actual fun T.functionWithTypeParameter1() {} -fun Q.functionWithTypeParameter2() {} -fun T.functionWithTypeParameter3() {} -fun Q.functionWithTypeParameter4() {} diff --git a/native/commonizer/testData/callableMemberCommonization/openCallableMemberInInterface/commonized/js/package_root.kt b/native/commonizer/testData/callableMemberCommonization/openCallableMemberInInterface/commonized/js/package_root.kt deleted file mode 100644 index 99b9d92f63f..00000000000 --- a/native/commonizer/testData/callableMemberCommonization/openCallableMemberInInterface/commonized/js/package_root.kt +++ /dev/null @@ -1,5 +0,0 @@ -actual interface Interface { - actual fun openFun() = Unit - fun openFunWithOtherParams(param: Int) = Unit - fun openInJs_abstractInJvm() = Unit -} diff --git a/native/commonizer/testData/callableMemberCommonization/openCallableMemberInInterface/commonized/jvm/package_root.kt b/native/commonizer/testData/callableMemberCommonization/openCallableMemberInInterface/commonized/jvm/package_root.kt deleted file mode 100644 index afb2a58fabf..00000000000 --- a/native/commonizer/testData/callableMemberCommonization/openCallableMemberInInterface/commonized/jvm/package_root.kt +++ /dev/null @@ -1,5 +0,0 @@ -actual interface Interface { - actual fun openFun() = Unit - fun openFunWithOtherParams(param: Double) = Unit - fun openInJs_abstractInJvm() -} diff --git a/native/commonizer/testData/callableMemberCommonization/returnTypes/commonized/js/package_root.kt b/native/commonizer/testData/callableMemberCommonization/returnTypes/commonized/js/package_root.kt deleted file mode 100644 index a88e812f93e..00000000000 --- a/native/commonizer/testData/callableMemberCommonization/returnTypes/commonized/js/package_root.kt +++ /dev/null @@ -1,80 +0,0 @@ -actual class Planet actual constructor(actual val name: String, actual val diameter: Double) - -actual val propertyWithInferredType1 = 1 -actual val propertyWithInferredType2 = "hello" -actual val propertyWithInferredType3 = 42.toString() -actual val propertyWithInferredType4 = null -actual val propertyWithInferredType5 = Planet("Earth", 12742) - -typealias A = Planet - -actual val property1 = 1 -actual val property2 = "hello" -actual val property3 = Planet("Earth", 12742) -val property4 = A("Earth", 12742) -val property5 = A("Earth", 12742) -actual val property6 = Planet("Earth", 12742) -actual val property7 = C("Earth", 12742) - -actual fun function1() = 1 -actual fun function2() = "hello" -actual fun function3() = Planet("Earth", 12742) -fun function4() = A("Earth", 12742) -fun function5() = A("Earth", 12742) -actual fun function6() = Planet("Earth", 12742) -actual fun function7() = C("Earth", 12742) - -val propertyWithMismatchedType1: Int = 1 -val propertyWithMismatchedType2: Int = 1 -val propertyWithMismatchedType3: Int = 1 -val propertyWithMismatchedType4: Int = 1 -val propertyWithMismatchedType5: Int = 1 - -fun functionWithMismatchedType1(): Int = 1 -fun functionWithMismatchedType2(): Int = 1 -fun functionWithMismatchedType3(): Int = 1 -fun functionWithMismatchedType4(): Int = 1 -fun functionWithMismatchedType5(): Int = 1 - -actual class Box actual constructor(actual val value: T) -actual class Fox actual constructor() - -actual fun functionWithTypeParametersInReturnType1() = arrayOf(1) -fun functionWithTypeParametersInReturnType2() = arrayOf(1) -actual fun functionWithTypeParametersInReturnType3() = arrayOf("hello") -actual fun functionWithTypeParametersInReturnType4(): List = listOf(1) -fun functionWithTypeParametersInReturnType5(): List = listOf(1) -actual fun functionWithTypeParametersInReturnType6(): List = listOf("hello") -actual fun functionWithTypeParametersInReturnType7() = Box(1) -fun functionWithTypeParametersInReturnType8() = Box(1) -actual fun functionWithTypeParametersInReturnType9() = Box("hello") -actual fun functionWithTypeParametersInReturnType10() = Box(Planet("Earth", 12742)) -fun functionWithTypeParametersInReturnType11() = Box(Planet("Earth", 12742)) -actual fun functionWithTypeParametersInReturnType12() = Box(Fox()) - -actual fun functionWithUnsubstitutedTypeParametersInReturnType1(): T = TODO() -actual fun functionWithUnsubstitutedTypeParametersInReturnType2(): T = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType3(): T = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType4(): T = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType5(): T = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType6(): T = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType7(): T = TODO() -actual fun functionWithUnsubstitutedTypeParametersInReturnType8(): Box = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType9(): Box = TODO() - -actual class Outer actual constructor() { - actual class Nested actual constructor() { - actual class Nested actual constructor() - actual inner class Inner actual constructor() - } - - actual inner class Inner actual constructor() { - actual inner class Inner actual constructor() - } -} - -actual fun returnOuter(): Outer = TODO() -actual fun returnOuterNested(): Outer.Nested = TODO() -actual fun returnOuterNestedNested(): Outer.Nested.Nested = TODO() -actual fun returnOuterInner(): Outer.Inner = TODO() -actual fun returnOuterInnerInner(): Outer.Inner.Inner = TODO() diff --git a/native/commonizer/testData/callableMemberCommonization/returnTypes/commonized/jvm/package_root.kt b/native/commonizer/testData/callableMemberCommonization/returnTypes/commonized/jvm/package_root.kt deleted file mode 100644 index 7933fb87a3b..00000000000 --- a/native/commonizer/testData/callableMemberCommonization/returnTypes/commonized/jvm/package_root.kt +++ /dev/null @@ -1,80 +0,0 @@ -actual class Planet actual constructor(actual val name: String, actual val diameter: Double) - -actual val propertyWithInferredType1 get() = 1 -actual val propertyWithInferredType2 get() = "hello" -actual val propertyWithInferredType3 get() = 42.toString() -actual val propertyWithInferredType4 get() = null -actual val propertyWithInferredType5 get() = Planet("Earth", 12742) - -typealias B = Planet - -actual val property1 = 1 -actual val property2 = "hello" -actual val property3 = Planet("Earth", 12742) -val property4: B = Planet("Earth", 12742) -val property5: Planet = A("Earth", 12742) -actual val property6: Planet = A("Earth", 12742) -actual val property7: C = Planet("Earth", 12742) - -actual fun function1(): Int = 1 -actual fun function2(): String = "hello" -actual fun function3(): Planet = Planet("Earth", 12742) -fun function4(): B = A("Earth", 12742) -fun function5(): Planet = A("Earth", 12742) -actual fun function6(): Planet = Planet("Earth", 12742) -actual fun function7(): C = C("Earth", 12742) - -val propertyWithMismatchedType1: Long = 1 -val propertyWithMismatchedType2: Short = 1 -val propertyWithMismatchedType3: Number = 1 -val propertyWithMismatchedType4: Comparable = 1 -val propertyWithMismatchedType5: String = 1.toString() - -fun functionWithMismatchedType1(): Long = 1 -fun functionWithMismatchedType2(): Short = 1 -fun functionWithMismatchedType3(): Number = 1 -fun functionWithMismatchedType4(): Comparable = 1 -fun functionWithMismatchedType5(): String = 1.toString() - -actual class Box actual constructor(actual val value: T) -actual class Fox actual constructor() - -actual fun functionWithTypeParametersInReturnType1() = arrayOf(1) -fun functionWithTypeParametersInReturnType2() = arrayOf("hello") -actual fun functionWithTypeParametersInReturnType3() = arrayOf("hello") -actual fun functionWithTypeParametersInReturnType4(): List = listOf(1) -fun functionWithTypeParametersInReturnType5(): List = listOf("hello") -actual fun functionWithTypeParametersInReturnType6(): List = listOf("hello") -actual fun functionWithTypeParametersInReturnType7() = Box(1) -fun functionWithTypeParametersInReturnType8() = Box("hello") -actual fun functionWithTypeParametersInReturnType9() = Box("hello") -actual fun functionWithTypeParametersInReturnType10() = Box(Planet("Earth", 12742)) -fun functionWithTypeParametersInReturnType11() = Box(Fox()) -actual fun functionWithTypeParametersInReturnType12() = Box(Fox()) - -actual fun functionWithUnsubstitutedTypeParametersInReturnType1(): T = TODO() -actual fun functionWithUnsubstitutedTypeParametersInReturnType2(): T = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType3(): T = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType4(): Q = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType5(): T = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType6(): Q = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType7(): String = TODO() -actual fun functionWithUnsubstitutedTypeParametersInReturnType8(): Box = TODO() -fun functionWithUnsubstitutedTypeParametersInReturnType9(): Box = TODO() - -actual class Outer actual constructor() { - actual class Nested actual constructor() { - actual class Nested actual constructor() - actual inner class Inner actual constructor() - } - - actual inner class Inner actual constructor() { - actual inner class Inner actual constructor() - } -} - -actual fun returnOuter(): Outer = TODO() -actual fun returnOuterNested(): Outer.Nested = TODO() -actual fun returnOuterNestedNested(): Outer.Nested.Nested = TODO() -actual fun returnOuterInner(): Outer.Inner = TODO() -actual fun returnOuterInnerInner(): Outer.Inner.Inner = TODO() diff --git a/native/commonizer/testData/callableMemberCommonization/visibility/commonized/js/package_root.kt b/native/commonizer/testData/callableMemberCommonization/visibility/commonized/js/package_root.kt deleted file mode 100644 index c8d7bcfe264..00000000000 --- a/native/commonizer/testData/callableMemberCommonization/visibility/commonized/js/package_root.kt +++ /dev/null @@ -1,67 +0,0 @@ -actual public val publicProperty = 1 -actual public val publicOrInternalProperty = 1 -actual internal val internalProperty = 1 -internal val internalOrPrivateProperty = 1 -private val privateProperty = 1 - -actual public fun publicFunction() = 1 -actual public fun publicOrInternalFunction() = 1 -actual internal fun internalFunction() = 1 -internal fun internalOrPrivateFunction() = 1 -private fun privateFunction() = 1 - -actual open class Outer1 actual constructor() { - actual public val publicProperty = 1 - actual public val publicOrInternalProperty = 1 - actual internal val internalProperty = 1 - internal val internalOrPrivateProperty = 1 - private val privateProperty = 1 - - actual public fun publicFunction() = 1 - actual public fun publicOrInternalFunction() = 1 - actual internal fun internalFunction() = 1 - internal fun internalOrPrivateFunction() = 1 - private fun privateFunction() = 1 - - actual open class Inner1 actual constructor() { - actual public val publicProperty = 1 - actual public val publicOrInternalProperty = 1 - actual internal val internalProperty = 1 - internal val internalOrPrivateProperty = 1 - private val privateProperty = 1 - - actual public fun publicFunction() = 1 - actual public fun publicOrInternalFunction() = 1 - actual internal fun internalFunction() = 1 - internal fun internalOrPrivateFunction() = 1 - private fun privateFunction() = 1 - } -} - -actual open class Outer2 actual constructor() { - actual public open val publicProperty = 1 - public open val publicOrInternalProperty = 1 - actual internal open val internalProperty = 1 - internal open val internalOrPrivateProperty = 1 - private val privateProperty = 1 - - actual public open fun publicFunction() = 1 - public open fun publicOrInternalFunction() = 1 - actual internal open fun internalFunction() = 1 - internal open fun internalOrPrivateFunction() = 1 - private fun privateFunction() = 1 - - actual open class Inner2 actual constructor() { - actual public open val publicProperty = 1 - public open val publicOrInternalProperty = 1 - actual internal open val internalProperty = 1 - internal open val internalOrPrivateProperty = 1 - private val privateProperty = 1 - - actual public open fun publicFunction() = 1 - public open fun publicOrInternalFunction() = 1 - actual internal open fun internalFunction() = 1 - internal open fun internalOrPrivateFunction() = 1 - private fun privateFunction() = 1 - } -} diff --git a/native/commonizer/testData/callableMemberCommonization/visibility/commonized/jvm/package_root.kt b/native/commonizer/testData/callableMemberCommonization/visibility/commonized/jvm/package_root.kt deleted file mode 100644 index 3ba5c9344bc..00000000000 --- a/native/commonizer/testData/callableMemberCommonization/visibility/commonized/jvm/package_root.kt +++ /dev/null @@ -1,67 +0,0 @@ -actual public val publicProperty = 1 -actual internal val publicOrInternalProperty = 1 -actual internal val internalProperty = 1 -private val internalOrPrivateProperty = 1 -private val privateProperty = 1 - -actual public fun publicFunction() = 1 -actual internal fun publicOrInternalFunction() = 1 -actual internal fun internalFunction() = 1 -private fun internalOrPrivateFunction() = 1 -private fun privateFunction() = 1 - -actual open class Outer1 actual constructor() { - actual public val publicProperty = 1 - actual internal val publicOrInternalProperty = 1 - actual internal val internalProperty = 1 - private val internalOrPrivateProperty = 1 - private val privateProperty = 1 - - actual public fun publicFunction() = 1 - actual internal fun publicOrInternalFunction() = 1 - actual internal fun internalFunction() = 1 - private fun internalOrPrivateFunction() = 1 - private fun privateFunction() = 1 - - actual open class Inner1 actual constructor() { - actual public val publicProperty = 1 - actual internal val publicOrInternalProperty = 1 - actual internal val internalProperty = 1 - private val internalOrPrivateProperty = 1 - private val privateProperty = 1 - - actual public fun publicFunction() = 1 - actual internal fun publicOrInternalFunction() = 1 - actual internal fun internalFunction() = 1 - private fun internalOrPrivateFunction() = 1 - private fun privateFunction() = 1 - } -} - -actual open class Outer2 actual constructor() { - actual public open val publicProperty = 1 - internal open val publicOrInternalProperty = 1 - actual internal open val internalProperty = 1 - private val internalOrPrivateProperty = 1 - private val privateProperty = 1 - - actual public open fun publicFunction() = 1 - internal open fun publicOrInternalFunction() = 1 - actual internal open fun internalFunction() = 1 - private fun internalOrPrivateFunction() = 1 - private fun privateFunction() = 1 - - actual open class Inner2 actual constructor() { - actual public open val publicProperty = 1 - internal open val publicOrInternalProperty = 1 - actual internal open val internalProperty = 1 - private val internalOrPrivateProperty = 1 - private val privateProperty = 1 - - actual public open fun publicFunction() = 1 - internal open fun publicOrInternalFunction() = 1 - actual internal open fun internalFunction() = 1 - private fun internalOrPrivateFunction() = 1 - private fun privateFunction() = 1 - } -} diff --git a/native/commonizer/testData/classifierCommonization/classKindAndModifiers/commonized/js/package_root.kt b/native/commonizer/testData/classifierCommonization/classKindAndModifiers/commonized/js/package_root.kt deleted file mode 100644 index e1c1b63d699..00000000000 --- a/native/commonizer/testData/classifierCommonization/classKindAndModifiers/commonized/js/package_root.kt +++ /dev/null @@ -1,147 +0,0 @@ -actual class A1 actual constructor() -class A2 -class A3 -class A4 -class A5 - -actual interface B1 -interface B2 -interface B3 -interface B4 - -actual annotation class C1 actual constructor() -annotation class C2 -annotation class C3 - -actual object D1 -object D2 - -actual enum class E1 { FOO, BAR, BAZ } - -actual class F actual constructor() { - actual inner class G1 actual constructor() - inner class G2 - inner class G3 - inner class G4 - inner class G5 - inner class G6 - - actual class H1 actual constructor() - class H2 - class H3 - class H4 - - actual interface I1 - interface I2 - interface I3 - - actual object J1 - object J2 - - actual enum class K1 { FOO, BAR, BAZ } -} - -actual interface L { - actual class M1 actual constructor() - class M2 - class M3 - class M4 - class M5 - - actual interface N1 - interface N2 - interface N3 - - actual object O1 - object O2 - - actual enum class P1 { FOO, BAR, BAZ } -} - -actual object R { - actual class S1 actual constructor() - class S2 - class S3 - class S4 - - actual interface T1 - interface T2 - interface T3 - - actual object U1 - object U2 - - actual enum class V1 { FOO, BAR, BAZ } -} - -actual class W actual constructor() { - actual object X { - actual interface Y { - actual class Z actual constructor() { - actual enum class AA { FOO, BAR, BAZ } - } - } - } -} - -actual class BB1 actual constructor() { - actual companion object -} - -actual class BB2 actual constructor() { - companion object -} - -actual class CC1 actual constructor() { - actual companion object DD1 -} - -actual class CC2 actual constructor() { - companion object DD2 -} - -actual class CC3 actual constructor() { - companion object DD3 -} - -actual inline class EE1 actual constructor(actual val value: String) -inline class EE2(val value: String) - -actual external class FF1 actual constructor(actual val property1: String) { - actual val property2 = property1 - actual val property3 get() = property1 - actual val property4: String - - actual fun function1() = property1 - actual fun function2(): String -} - -actual external class FF2 actual constructor() - -actual sealed class GG1 -actual sealed class GG2 { - actual class HH1 actual constructor() : GG2() - actual object HH2 : GG2() - class HH3 : GG2() -} - -actual class HH5 actual constructor() : GG2() -actual object HH6 : GG2() -class HH7 : GG2() - -actual enum class II1 -actual enum class II2 { FOO, BAR } - -actual interface JJ { - actual val property: String - actual fun function(): String -} - -actual class KK1 actual constructor(actual override val property: String) : JJ { - actual override fun function() = property -} - -actual class KK2 actual constructor(private val wrapped: JJ) : JJ by wrapped - -actual data class LL1 actual constructor(actual val value: String) -actual data class LL2 actual constructor(actual val value: String) diff --git a/native/commonizer/testData/classifierCommonization/classKindAndModifiers/commonized/jvm/package_root.kt b/native/commonizer/testData/classifierCommonization/classKindAndModifiers/commonized/jvm/package_root.kt deleted file mode 100644 index 2a639539fd2..00000000000 --- a/native/commonizer/testData/classifierCommonization/classKindAndModifiers/commonized/jvm/package_root.kt +++ /dev/null @@ -1,147 +0,0 @@ -actual class A1 actual constructor() -interface A2 -annotation class A3 -object A4 -enum class A5 { FOO, BAR, BAZ } - -actual interface B1 -annotation class B2 -object B3 -enum class B4 { FOO, BAR, BAZ } - -actual annotation class C1 actual constructor() -object C2 -enum class C3 { FOO, BAR, BAZ } - -actual object D1 -enum class D2 { FOO, BAR, BAZ } - -actual enum class E1 { FOO, BAR, BAZ } - -actual class F actual constructor() { - actual inner class G1 actual constructor() - class G2 - interface G3 - object G4 - enum class G5 { FOO, BAR, BAZ } - companion object G6 - - actual class H1 actual constructor() - interface H2 - object H3 - enum class H4 { FOO, BAR, BAZ } - - actual interface I1 - object I2 - enum class I3 { FOO, BAR, BAZ } - - actual object J1 - enum class J2 { FOO, BAR, BAZ } - - actual enum class K1 { FOO, BAR, BAZ } -} - -actual interface L { - actual class M1 actual constructor() - interface M2 - object M3 - enum class M4 { FOO, BAR, BAZ } - companion object M5 - - actual interface N1 - object N2 - enum class N3 { FOO, BAR, BAZ } - - actual object O1 - enum class O2 { FOO, BAR, BAZ } - - actual enum class P1 { FOO, BAR, BAZ } -} - -actual object R { - actual class S1 actual constructor() - interface S2 - object S3 - enum class S4 { FOO, BAR, BAZ } - - actual interface T1 - object T2 - enum class T3 { FOO, BAR, BAZ } - - actual object U1 - enum class U2 { FOO, BAR, BAZ } - - actual enum class V1 { FOO, BAR, BAZ } -} - -actual class W actual constructor() { - actual object X { - actual interface Y { - actual class Z actual constructor() { - actual enum class AA { FOO, BAR, BAZ } - } - } - } -} - -actual class BB1 actual constructor() { - actual companion object -} - -actual class BB2 actual constructor() - -actual class CC1 actual constructor() { - actual companion object DD1 -} - -actual class CC2 actual constructor() { - companion object CompanionWithAnotherName -} - -actual class CC3 actual constructor() { - companion object -} - -actual inline class EE1 actual constructor(actual val value: String) -class EE2(val value: String) - -actual class FF1 actual constructor(actual val property1: String) { - actual val property2 = property1 - actual val property3 get() = property1 - actual val property4 = property1 - - actual fun function1() = property1 - actual fun function2() = function1() -} - -actual external class FF2 actual constructor() - -actual sealed class GG1 -actual sealed class GG2 { - actual class HH1 actual constructor() : GG2() - actual object HH2 : GG2() - class HH4 : GG2() -} - -actual class HH5 actual constructor() : GG2() -actual object HH6 : GG2() -class HH8 : GG2() - -actual enum class II1 -actual enum class II2 { FOO, BAZ } - -actual interface JJ { - actual val property: String - val property2: String - actual fun function(): String -} - -actual class KK1 actual constructor(actual override val property: String) : JJ { - val property2 = property - actual override fun function() = property -} - -actual class KK2 actual constructor(wrapped: JJ) : JJ by wrapped - -actual data class LL1 actual constructor(actual val value: String) -actual class LL2 actual constructor(actual val value: String) diff --git a/native/commonizer/testData/classifierCommonization/constructors/commonized/js/package_root.kt b/native/commonizer/testData/classifierCommonization/constructors/commonized/js/package_root.kt deleted file mode 100644 index 2b23cf12f7f..00000000000 --- a/native/commonizer/testData/classifierCommonization/constructors/commonized/js/package_root.kt +++ /dev/null @@ -1,59 +0,0 @@ -actual class A1 actual constructor(text: String) { - actual constructor(number: Int) : this(number.toString()) -} - -actual class A2 actual constructor(text: String) { - actual constructor(number: Int) : this(number.toString()) -} - -actual class A3(text: String) { - constructor(number: Int) : this(number.toString()) -} - -actual class A4(text: String) { - constructor(number: Int) : this(number.toString()) -} - -actual class A5(text: String) { - constructor(number: Int) : this(number.toString()) -} - -actual class B1 protected actual constructor(text: String) { - protected actual constructor(number: Int) : this(number.toString()) -} - -actual class B2 protected constructor(text: String) { - protected constructor(number: Int) : this(number.toString()) -} - -actual class B3 protected constructor(text: String) { - protected constructor(number: Int) : this(number.toString()) -} - -actual class C1 internal actual constructor(text: String) { - internal actual constructor(number: Int) : this(number.toString()) -} - -actual class C2 internal constructor(text: String) { - internal constructor(number: Int) : this(number.toString()) -} - -actual class D1 private constructor(text: String) { - private constructor(number: Int) : this(number.toString()) -} - -actual class E { - constructor(a: Int) - actual constructor(a: Any) - - constructor(a: Int, b: String) - constructor(a: Int, b: Any) - actual constructor(a: Any, b: String) - actual constructor(a: Any, b: Int) -} - -actual enum class F(actual val alias: String) { - FOO("foo"), - BAR("bar"), - BAZ("baz") -} diff --git a/native/commonizer/testData/classifierCommonization/constructors/commonized/jvm/package_root.kt b/native/commonizer/testData/classifierCommonization/constructors/commonized/jvm/package_root.kt deleted file mode 100644 index d498c560dc5..00000000000 --- a/native/commonizer/testData/classifierCommonization/constructors/commonized/jvm/package_root.kt +++ /dev/null @@ -1,59 +0,0 @@ -actual class A1 actual constructor(text: String) { - actual constructor(number: Int) : this(number.toString()) -} - -actual class A2 actual constructor(text: String) { - actual constructor(number: Int) : this(number.toString()) -} - -actual class A3 protected constructor(text: String) { - protected constructor(number: Int) : this(number.toString()) -} - -actual class A4 internal constructor(text: String) { - internal constructor(number: Int) : this(number.toString()) -} - -actual class A5 private constructor(text: String) { - private constructor(number: Int) : this(number.toString()) -} - -actual class B1 protected actual constructor(text: String) { - protected actual constructor(number: Int) : this(number.toString()) -} - -actual class B2 internal constructor(text: String) { - internal constructor(number: Int) : this(number.toString()) -} - -actual class B3 private constructor(text: String) { - private constructor(number: Int) : this(number.toString()) -} - -actual class C1 internal actual constructor(text: String) { - internal actual constructor(number: Int) : this(number.toString()) -} - -actual class C2 private constructor(text: String) { - private constructor(number: Int) : this(number.toString()) -} - -actual class D1 private constructor(text: String) { - private constructor(number: Int) : this(number.toString()) -} - -actual class E { - constructor(a: String) - actual constructor(a: Any) - - constructor(a: String, b: Int) - constructor(a: String, b: Any) - actual constructor(a: Any, b: String) - actual constructor(a: Any, b: Int) -} - -actual enum class F(actual val alias: String) { - FOO("foo"), - BAR("bar"), - BAZ("baz") -} diff --git a/native/commonizer/testData/classifierCommonization/differentTypeAliasesInArguments/commonized/linux/package_root.kt b/native/commonizer/testData/classifierCommonization/differentTypeAliasesInArguments/commonized/linux/package_root.kt deleted file mode 100644 index 184a52e6495..00000000000 --- a/native/commonizer/testData/classifierCommonization/differentTypeAliasesInArguments/commonized/linux/package_root.kt +++ /dev/null @@ -1,3 +0,0 @@ -typealias my_linux_long_t = common.stuff.MyLong - -actual val property: MyTypeAlias = TODO() diff --git a/native/commonizer/testData/classifierCommonization/differentTypeAliasesInArguments/commonized/macos/package_root.kt b/native/commonizer/testData/classifierCommonization/differentTypeAliasesInArguments/commonized/macos/package_root.kt deleted file mode 100644 index 962bc967f1e..00000000000 --- a/native/commonizer/testData/classifierCommonization/differentTypeAliasesInArguments/commonized/macos/package_root.kt +++ /dev/null @@ -1,3 +0,0 @@ -typealias my_macos_long_t = common.stuff.MyLong - -actual val property: MyTypeAlias = TODO() diff --git a/native/commonizer/testData/classifierCommonization/modality/commonized/js/package_root.kt b/native/commonizer/testData/classifierCommonization/modality/commonized/js/package_root.kt deleted file mode 100644 index 5558ca63109..00000000000 --- a/native/commonizer/testData/classifierCommonization/modality/commonized/js/package_root.kt +++ /dev/null @@ -1,33 +0,0 @@ -actual final class A1 actual constructor() -actual final class A2 actual constructor() -final class A3 -final class A4 - -actual open class B1 actual constructor() -open class B2 -open class B3 - -actual abstract class C1 actual constructor() -abstract class C2 - -actual sealed class D1 - -actual abstract class E actual constructor() { - actual final val p1: Int = 1 - actual final val p2: Int = 1 - final val p3: Int = 1 - - actual open val p4: Int = 1 - open val p5: Int = 1 - - actual abstract val p6: Int - - actual final fun f1(): Int = 1 - actual final fun f2(): Int = 1 - final fun f3(): Int = 1 - - actual open fun f4(): Int = 1 - open fun f5(): Int = 1 - - actual abstract fun f6(): Int -} diff --git a/native/commonizer/testData/classifierCommonization/modality/commonized/jvm/package_root.kt b/native/commonizer/testData/classifierCommonization/modality/commonized/jvm/package_root.kt deleted file mode 100644 index 9a36d067fcf..00000000000 --- a/native/commonizer/testData/classifierCommonization/modality/commonized/jvm/package_root.kt +++ /dev/null @@ -1,33 +0,0 @@ -actual final class A1 actual constructor() -actual open class A2 actual constructor() -abstract class A3 -sealed class A4 - -actual open class B1 actual constructor() -abstract class B2 -sealed class B3 - -actual abstract class C1 actual constructor() -sealed class C2 - -actual sealed class D1 - -actual abstract class E actual constructor() { - actual final val p1: Int = 1 - actual open val p2: Int = 1 - abstract val p3: Int - - actual open val p4: Int = 1 - abstract val p5: Int - - actual abstract val p6: Int - - actual final fun f1(): Int = 1 - actual open fun f2(): Int = 1 - abstract fun f3(): Int - - actual open fun f4(): Int = 1 - abstract fun f5(): Int - - actual abstract fun f6(): Int -} diff --git a/native/commonizer/testData/classifierCommonization/supertypes/commonized/js/package_root.kt b/native/commonizer/testData/classifierCommonization/supertypes/commonized/js/package_root.kt deleted file mode 100644 index d75c347252f..00000000000 --- a/native/commonizer/testData/classifierCommonization/supertypes/commonized/js/package_root.kt +++ /dev/null @@ -1,79 +0,0 @@ -actual interface A1 { - actual val property1: Int - actual fun function1(): Int -} - -actual abstract class A2 actual constructor() : A1 { - actual abstract val property2: Int - actual abstract fun function2(): Int -} - -actual class A3 actual constructor() : A2() { - actual override val property1 = 1 - actual override val property2 = 1 - actual val property3 = 1 - - actual override fun function1() = 1 - actual override fun function2() = 1 - actual fun function3() = 1 -} - -actual interface B1 { - actual val property1: Int - actual fun function1(): Int -} - -interface B2 { - val property2: Int - fun function2(): Int -} - -actual class B3 actual constructor() : B1, B2 { - actual override val property1 = 1 - actual override val property2 = 1 - actual val property3 = 1 - - actual override fun function1() = 1 - actual override fun function2() = 1 - actual fun function3() = 1 -} - -actual interface C1 { - actual val property1: Int - actual fun function1(): Int -} - -interface C2 { - val property2: Int - fun function2(): Int -} - -actual class C3 actual constructor() : C1, C2 { - actual override val property1 = 1 - actual override val property2 = 1 - actual val property3 = 1 - - actual override fun function1() = 1 - actual override fun function2() = 1 - actual fun function3() = 1 -} - -interface D1 { - val property1: Int - fun function1(): Int -} - -actual interface D2 { - actual val property2: Int - actual fun function2(): Int -} - -actual class D3 actual constructor() : D1, D2 { - actual override val property1 = 1 - actual override val property2 = 1 - actual val property3 = 1 - - actual override fun function1() = 1 - actual override fun function2() = 1 - actual fun function3() = 1 -} diff --git a/native/commonizer/testData/classifierCommonization/supertypes/commonized/jvm/package_root.kt b/native/commonizer/testData/classifierCommonization/supertypes/commonized/jvm/package_root.kt deleted file mode 100644 index a2640bbc03d..00000000000 --- a/native/commonizer/testData/classifierCommonization/supertypes/commonized/jvm/package_root.kt +++ /dev/null @@ -1,72 +0,0 @@ -actual interface A1 { - actual val property1: Int - actual fun function1(): Int -} - -actual abstract class A2 actual constructor() : A1 { - actual abstract val property2: Int - actual abstract fun function2(): Int -} - -actual class A3 actual constructor() : A2(), A1 { - actual override val property1 = 1 - actual override val property2 = 1 - actual val property3 = 1 - - actual override fun function1() = 1 - actual override fun function2() = 1 - actual fun function3() = 1 -} - -actual interface B1 { - actual val property1: Int - val property2: Int - - actual fun function1(): Int - fun function2(): Int -} - -actual class B3 actual constructor() : B1 { - actual override val property1 = 1 - actual override val property2 = 1 - actual val property3 = 1 - - actual override fun function1() = 1 - actual override fun function2() = 1 - actual fun function3() = 1 -} - -actual interface C1 { - actual val property1: Int - actual fun function1(): Int -} - -actual class C3 actual constructor() : C1 { - actual override val property1 = 1 - actual val property2 = 1 - actual val property3 = 1 - - actual override fun function1() = 1 - actual fun function2() = 1 - actual fun function3() = 1 -} - -abstract class D1 { - abstract val property1: Int - abstract fun function1(): Int -} - -actual interface D2 { - actual val property2: Int - actual fun function2(): Int -} - -actual class D3 actual constructor() : D1(), D2 { - actual override val property1 = 1 - actual override val property2 = 1 - actual val property3 = 1 - - actual override fun function1() = 1 - actual override fun function2() = 1 - actual fun function3() = 1 -} diff --git a/native/commonizer/testData/classifierCommonization/typeAliases/commonized/linux/package_root.kt b/native/commonizer/testData/classifierCommonization/typeAliases/commonized/linux/package_root.kt deleted file mode 100644 index 38af937ef0a..00000000000 --- a/native/commonizer/testData/classifierCommonization/typeAliases/commonized/linux/package_root.kt +++ /dev/null @@ -1,25 +0,0 @@ -actual class A actual constructor() - -// Lifted up type aliases: -typealias G = List // different parameterized types at the RHS - -typealias I = List // TAs with own parameters with different names - -typealias K = Function // function types with different type parameter names -typealias L = () -> T // different kinds of function types -typealias N = () -> Any // different return types -typealias P = (Int) -> Int // different argument types - -// Type aliases converted to expect classes: -actual typealias T = Int - -// Nullability: -actual typealias V = A? // different nullability of the RHS class -typealias X = U? // different nullability of the RHS TA - -// Supertypes: -actual typealias FILE = _IO_FILE - -final class _IO_FILE : kotlinx.cinterop.CStructVar {} - -actual val uuid: uuid_t get() = TODO() diff --git a/native/commonizer/testData/classifierCommonization/typeAliases/commonized/macos/package_root.kt b/native/commonizer/testData/classifierCommonization/typeAliases/commonized/macos/package_root.kt deleted file mode 100644 index 7d66ad738e2..00000000000 --- a/native/commonizer/testData/classifierCommonization/typeAliases/commonized/macos/package_root.kt +++ /dev/null @@ -1,113 +0,0 @@ -actual class A actual constructor() - -// Lifted up type aliases: -typealias G = List // different parameterized types at the RHS - -typealias I = List // TAs with own parameters with different names - -typealias K = Function // function types with different type parameter names -typealias L = Function // different kinds of function types -typealias N = () -> Unit // different return types -typealias P = (String) -> Int // different argument types - -// Type aliases converted to expect classes: -actual typealias T = String - -// Nullability: -actual typealias V = A // different nullability of the RHS class -typealias X = U // different nullability of the RHS TA - -// Supertypes: -actual typealias FILE = __sFILE - -final class __sFILE : kotlinx.cinterop.CStructVar {} - -actual val uuid: uuid_t get() = TODO() - -// Type alias chain that is present in one target only: -class AA -typealias BB = AA -typealias CC = BB -typealias DD = CC -typealias EE = List -typealias FF = EE -typealias GG = FF -typealias HH = List -typealias II = HH -typealias JJ = II -typealias KK = HH -typealias LL = II -typealias MM = JJ -typealias NN = (String) -> Int -typealias OO = NN -typealias PP = OO -typealias QQ = (T1) -> T2 -typealias RR = QQ -typealias SS = RR -typealias TT = QQ -typealias UU = RR -typealias VV = SS -typealias WW = TT -typealias XX = UU -typealias YY = VV -typealias ZZ = QQ -typealias AAA = ZZ -typealias BBB = AAA -typealias CCC = QQ -typealias DDD = CCC -typealias EEE = DDD -typealias FFF = RR -typealias GGG = FFF -typealias HHH = GGG -typealias III = RR -typealias JJJ = III -typealias KKK = JJJ -typealias LLL = SS -typealias MMM = LLL -typealias NNN = MMM -typealias OOO = SS -typealias PPP = OOO -typealias QQQ = PPP - -fun getBB(): BB = TODO() -fun getCC(): CC = TODO() -fun getDD(): DD = TODO() -fun getEE(): EE = TODO() -fun getFF(): FF = TODO() -fun getGG(): GG = TODO() -fun getHH(): HH = TODO() -fun getII(): II = TODO() -fun getJJ(): JJ = TODO() -fun getKK(): KK = TODO() -fun getLL(): LL = TODO() -fun getMM(): MM = TODO() -fun getNN(): NN = TODO() -fun getOO(): OO = TODO() -fun getPP(): PP = TODO() -fun getQQ(): QQ = TODO() -fun getRR(): RR = TODO() -fun getSS(): SS = TODO() -fun getTT(): TT = TODO() -fun getUU(): UU = TODO() -fun getVV(): VV = TODO() -fun getWW(): WW = TODO() -fun getXX(): XX = TODO() -fun getYY(): YY = TODO() -fun getZZ(): ZZ = TODO() -fun getAAA(): AAA = TODO() -fun getBBB(): BBB = TODO() -fun getCCC(): CCC = TODO() -fun getDDD(): DDD = TODO() -fun getEEE(): EEE = TODO() -fun getFFF(): FFF = TODO() -fun getGGG(): GGG = TODO() -fun getHHH(): HHH = TODO() -fun getIII(): III = TODO() -fun getJJJ(): JJJ = TODO() -fun getKKK(): KKK = TODO() -fun getLLL(): LLL = TODO() -fun getMMM(): MMM = TODO() -fun getNNN(): NNN = TODO() -fun getOOO(): OOO = TODO() -fun getPPP(): PPP = TODO() -fun getQQQ(): QQQ = TODO() diff --git a/native/commonizer/testData/classifierCommonization/typeParameters/commonized/js/package_root.kt b/native/commonizer/testData/classifierCommonization/typeParameters/commonized/js/package_root.kt deleted file mode 100644 index e82e6c745eb..00000000000 --- a/native/commonizer/testData/classifierCommonization/typeParameters/commonized/js/package_root.kt +++ /dev/null @@ -1,697 +0,0 @@ -class A1 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -actual class A2 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class A3 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class A4 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class A5 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class A6 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class A7 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class B1 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class B2 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class B3 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -actual class B4 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class B5 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class B6 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class B7 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class C1 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class C2 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class C3 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class C4 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -actual class C5 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class C6 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class C7 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class D1 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class D2 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class D3 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class D4 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class D5 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -actual class D6 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class D7 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class E1 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class E2 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class E3 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class E4 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class E5 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class E6 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -actual class E7 actual constructor() { - actual val property: String get() = TODO() - actual fun function(value: String): String = value - - actual class Nested actual constructor() { - actual val property: String get() = TODO() - actual fun function(value: String): String = value - } - - actual inner class Inner actual constructor() { - actual val property: String get() = TODO() - actual fun function(value: String): String = value - } -} - -actual class F1 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class F2 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class F3 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -actual class G1 actual constructor() { - actual val property1: T get() = TODO() - actual val property2: R get() = TODO() - actual fun function(value: T): R = TODO() - - actual class Nested actual constructor() { - actual val property1: T get() = TODO() - actual val property2: R get() = TODO() - actual fun function(value: T): R = TODO() - } - - actual inner class Inner actual constructor() { - actual val property1: T get() = TODO() - actual val property2: R get() = TODO() - actual fun function(value: T): R = TODO() - } -} - -class G2 { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - - class Nested { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - } - - inner class Inner { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - } -} - -class G3 { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - - class Nested { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - } - - inner class Inner { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - } -} - -class G4 { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - - class Nested { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - } - - inner class Inner { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - } -} - -actual class H1 actual constructor() { - actual val dependentProperty: T get() = TODO() - actual fun dependentFunction(value: T): T = value - - actual val T.dependentExtensionProperty: T get() = this - actual fun T.dependentExtensionFunction(): T = this - - actual fun independentFunction(): T = TODO() - - actual val T.independentExtensionProperty: T get() = this - actual fun T.independentExtensionFunction(): T = this -} - -actual class H2 actual constructor() { - actual val dependentProperty: T get() = TODO() - actual fun dependentFunction(value: T): T = value - - actual val T.dependentExtensionProperty: T get() = this - actual fun T.dependentExtensionFunction(): T = this - - fun independentFunction(): T = TODO() - - val T.independentExtensionProperty: T get() = this - fun T.independentExtensionFunction(): T = this -} - -actual class I> actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value -} - -actual interface J1 { - actual fun a(): A -} - -actual interface J2 { - actual fun a(b: B): A - actual fun b(a: A): B -} - -actual interface J3 { - actual fun a(b: B, c: C): A - actual fun b(a: A, c: C): B - actual fun c(a: A, b: B): C -} - -actual class K, D : J2> actual constructor() : J3 { - actual override fun a(b: C, c: B): D = TODO() - actual override fun b(a: D, c: B): C = TODO() - actual override fun c(a: D, b: C): B = TODO() - actual inner class Inner> actual constructor() { - actual fun dependentFunction(value: A): E = TODO() - actual fun independentFunction(value: A): E = TODO() - } -} diff --git a/native/commonizer/testData/classifierCommonization/typeParameters/commonized/jvm/package_root.kt b/native/commonizer/testData/classifierCommonization/typeParameters/commonized/jvm/package_root.kt deleted file mode 100644 index f35c145b5e0..00000000000 --- a/native/commonizer/testData/classifierCommonization/typeParameters/commonized/jvm/package_root.kt +++ /dev/null @@ -1,697 +0,0 @@ -class A1 { - val property: Any get() = TODO() - fun function(value: Any): Any = value - - class Nested { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } - - inner class Inner { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } -} - -actual class A2 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class A3 { - val property: R get() = TODO() - fun function(value: R): R = value - - class Nested { - val property: R get() = TODO() - fun function(value: R): R = value - } - - inner class Inner { - val property: R get() = TODO() - fun function(value: R): R = value - } -} - -class A4 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class A5 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class A6 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class A7 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class B1 { - val property: Any get() = TODO() - fun function(value: Any): Any = value - - class Nested { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } - - inner class Inner { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } -} - -class B2 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class B3 { - val property: R get() = TODO() - fun function(value: R): R = value - - class Nested { - val property: R get() = TODO() - fun function(value: R): R = value - } - - inner class Inner { - val property: R get() = TODO() - fun function(value: R): R = value - } -} - -actual class B4 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class B5 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class B6 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class B7 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class C1 { - val property: Any get() = TODO() - fun function(value: Any): Any = value - - class Nested { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } - - inner class Inner { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } -} - -class C2 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class C3 { - val property: R get() = TODO() - fun function(value: R): R = value - - class Nested { - val property: R get() = TODO() - fun function(value: R): R = value - } - - inner class Inner { - val property: R get() = TODO() - fun function(value: R): R = value - } -} - -class C4 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -actual class C5 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class C6 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class C7 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class D1 { - val property: Any get() = TODO() - fun function(value: Any): Any = value - - class Nested { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } - - inner class Inner { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } -} - -class D2 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class D3 { - val property: R get() = TODO() - fun function(value: R): R = value - - class Nested { - val property: R get() = TODO() - fun function(value: R): R = value - } - - inner class Inner { - val property: R get() = TODO() - fun function(value: R): R = value - } -} - -class D4 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class D5 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -actual class D6 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class D7 { - val property: String get() = TODO() - fun function(value: String): String = value - - class Nested { - val property: String get() = TODO() - fun function(value: String): String = value - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: String): String = value - } -} - -class E1 { - val property: Any get() = TODO() - fun function(value: Any): Any = value - - class Nested { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } - - inner class Inner { - val property: Any get() = TODO() - fun function(value: Any): Any = value - } -} - -class E2 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class E3 { - val property: R get() = TODO() - fun function(value: R): R = value - - class Nested { - val property: R get() = TODO() - fun function(value: R): R = value - } - - inner class Inner { - val property: R get() = TODO() - fun function(value: R): R = value - } -} - -class E4 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class E5 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -class E6 { - val property: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: T): T = value - } -} - -actual class E7 actual constructor() { - actual val property: String get() = TODO() - actual fun function(value: String): String = value - - actual class Nested actual constructor() { - actual val property: String get() = TODO() - actual fun function(value: String): String = value - } - - actual inner class Inner actual constructor() { - actual val property: String get() = TODO() - actual fun function(value: String): String = value - } -} - -actual class F1 actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - - actual class Nested actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } - - actual inner class Inner actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value - } -} - -class F2 { - val property: String get() = TODO() - fun function(value: T): Any = TODO() - - class Nested { - val property: String get() = TODO() - fun function(value: T): Any = TODO() - } - - inner class Inner { - val property: String get() = TODO() - fun function(value: T): Any = TODO() - } -} - -class F3 { - val property: T get() = TODO() - fun function(value: Any): T = TODO() - - class Nested { - val property: T get() = TODO() - fun function(value: Any): T = TODO() - } - - inner class Inner { - val property: T get() = TODO() - fun function(value: Any): T = TODO() - } -} - -actual class G1 actual constructor() { - actual val property1: T get() = TODO() - actual val property2: R get() = TODO() - actual fun function(value: T): R = TODO() - - actual class Nested actual constructor() { - actual val property1: T get() = TODO() - actual val property2: R get() = TODO() - actual fun function(value: T): R = TODO() - } - - actual inner class Inner actual constructor() { - actual val property1: T get() = TODO() - actual val property2: R get() = TODO() - actual fun function(value: T): R = TODO() - } -} - -class G2 { - val property1: T get() = TODO() - val property2: T get() = TODO() - fun function(value: T): T = value - - class Nested { - val property1: T get() = TODO() - val property2: T get() = TODO() - fun function(value: T): T = value - } - - inner class Inner { - val property1: T get() = TODO() - val property2: T get() = TODO() - fun function(value: T): T = value - } -} - -class G3 { - val property1: R get() = TODO() - val property2: R get() = TODO() - fun function(value: R): R = value - - class Nested { - val property1: R get() = TODO() - val property2: R get() = TODO() - fun function(value: R): R = value - } - - inner class Inner { - val property1: R get() = TODO() - val property2: R get() = TODO() - fun function(value: R): R = value - } -} - -class G4 { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - - class Nested { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - } - - inner class Inner { - val property1: T get() = TODO() - val property2: R get() = TODO() - fun function(value: T): R = TODO() - } -} - -actual class H1 actual constructor() { - actual val dependentProperty: T get() = TODO() - actual fun dependentFunction(value: T): T = value - - actual val T.dependentExtensionProperty: T get() = this - actual fun T.dependentExtensionFunction(): T = this - - actual fun independentFunction(): T = TODO() - - actual val T.independentExtensionProperty: T get() = this - actual fun T.independentExtensionFunction(): T = this -} - -actual class H2 actual constructor() { - actual val dependentProperty: T get() = TODO() - actual fun dependentFunction(value: T): T = value - - actual val T.dependentExtensionProperty: T get() = this - actual fun T.dependentExtensionFunction(): T = this - - fun independentFunction(): T = TODO() - - val T.independentExtensionProperty: T get() = this - fun T.independentExtensionFunction(): T = this -} - -actual class I> actual constructor() { - actual val property: T get() = TODO() - actual fun function(value: T): T = value -} - -actual interface J1 { - actual fun a(): A -} - -actual interface J2 { - actual fun a(b: B): A - actual fun b(a: A): B -} - -actual interface J3 { - actual fun a(b: B, c: C): A - actual fun b(a: A, c: C): B - actual fun c(a: A, b: B): C -} - -actual class K, D : J2> actual constructor() : J3 { - actual override fun a(b: C, c: B): D = TODO() - actual override fun b(a: D, c: B): C = TODO() - actual override fun c(a: D, b: C): B = TODO() - actual inner class Inner> actual constructor() { - actual fun dependentFunction(value: A): E = TODO() - actual fun independentFunction(value: A): E = TODO() - } -} diff --git a/native/commonizer/testData/classifierCommonization/visibility/commonized/js/package_root.kt b/native/commonizer/testData/classifierCommonization/visibility/commonized/js/package_root.kt deleted file mode 100644 index 7589391366f..00000000000 --- a/native/commonizer/testData/classifierCommonization/visibility/commonized/js/package_root.kt +++ /dev/null @@ -1,24 +0,0 @@ -public actual class A1 actual constructor() -public class A2 -public class A3 -public class A4 - -protected actual class B1 actual constructor() -protected class B2 -protected class B3 - -internal actual class C1 actual constructor() -internal class C2 - -private class D1 - -public actual typealias E4 = A1 - -protected actual typealias F2 = A1 -protected actual typealias F3 = A1 - -internal actual typealias G2 = A1 - -private actual typealias H1 = A1 - -typealias I4 = D1 diff --git a/native/commonizer/testData/classifierCommonization/visibility/commonized/jvm/package_root.kt b/native/commonizer/testData/classifierCommonization/visibility/commonized/jvm/package_root.kt deleted file mode 100644 index 24e7ccc7c73..00000000000 --- a/native/commonizer/testData/classifierCommonization/visibility/commonized/jvm/package_root.kt +++ /dev/null @@ -1,24 +0,0 @@ -public actual class A1 actual constructor() -protected class A2 -internal class A3 -private class A4 - -protected actual class B1 actual constructor() -internal class B2 -private class B3 - -internal actual class C1 actual constructor() -private class C2 - -private class D1 - -private actual typealias E4 = A1 - -internal actual typealias F2 = A1 -private actual typealias F3 = A1 - -private actual typealias G2 = A1 - -private actual typealias H1 = A1 - -typealias I4 = D1 diff --git a/native/commonizer/testData/functionCommonization/annotations/commonized/js/package_root.kt b/native/commonizer/testData/functionCommonization/annotations/commonized/js/package_root.kt deleted file mode 100644 index d54fd834a6e..00000000000 --- a/native/commonizer/testData/functionCommonization/annotations/commonized/js/package_root.kt +++ /dev/null @@ -1,88 +0,0 @@ -actual class Holder actual constructor() { - @Deprecated("This function is deprecated") - actual fun deprecatedFunction1() { - } - - @Deprecated("This function is deprecated") - fun deprecatedFunction2() { - } - - @Deprecated("This function is deprecated") - actual fun deprecatedFunctionWithCustomizedAnnotation1() { - } - - @Deprecated("This function is deprecated") - actual fun deprecatedFunctionWithCustomizedAnnotation2() { - } - - @Deprecated("This function is deprecated", level = DeprecationLevel.WARNING) - actual fun deprecatedFunctionWithCustomizedAnnotation3() { - } - - @Deprecated("This function is deprecated") - actual fun deprecatedFunctionWithCustomizedAnnotation4() { - } - - @Deprecated("This function is deprecated") - actual fun deprecatedFunctionWithCustomizedAnnotation5() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("")) - actual fun deprecatedFunctionWithCustomizedAnnotation6() { - } - - @Deprecated("This function is deprecated") - actual fun deprecatedFunctionWithCustomizedAnnotation7() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("")) - actual fun deprecatedFunctionWithCustomizedAnnotation8() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = emptyArray())) - actual fun deprecatedFunctionWithCustomizedAnnotation9() { - } - - @Deprecated("This function is deprecated") - actual fun deprecatedFunctionWithCustomizedAnnotation10() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()")) - actual fun deprecatedFunctionWithCustomizedAnnotation11() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("bar()")) - actual fun deprecatedFunctionWithCustomizedAnnotation12() { - } - - @Deprecated("This function is deprecated") - actual fun deprecatedFunctionWithCustomizedAnnotation13() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("")) - actual fun deprecatedFunctionWithCustomizedAnnotation14() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation15() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = arrayOf("org.sample.bar"))) - actual fun deprecatedFunctionWithCustomizedAnnotation16() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation17() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()", imports = arrayOf("org.sample.bar"))) - actual fun deprecatedFunctionWithCustomizedAnnotation18() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("bar()", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation19() { - } - - actual fun nonDeprecatedFunction1() {} - fun nonDeprecatedFunction2() {} -} diff --git a/native/commonizer/testData/functionCommonization/annotations/commonized/jvm/package_root.kt b/native/commonizer/testData/functionCommonization/annotations/commonized/jvm/package_root.kt deleted file mode 100644 index 8a384f91d40..00000000000 --- a/native/commonizer/testData/functionCommonization/annotations/commonized/jvm/package_root.kt +++ /dev/null @@ -1,88 +0,0 @@ -actual class Holder actual constructor() { - @Deprecated("This function is deprecated") - actual fun deprecatedFunction1() { - } - - @Deprecated("This function is deprecated") - fun deprecatedFunction3() { - } - - @Deprecated("This function is deprecated as well") - actual fun deprecatedFunctionWithCustomizedAnnotation1() { - } - - @Deprecated("This function is deprecated", level = DeprecationLevel.WARNING) - actual fun deprecatedFunctionWithCustomizedAnnotation2() { - } - - @Deprecated("This function is deprecated", level = DeprecationLevel.WARNING) - actual fun deprecatedFunctionWithCustomizedAnnotation3() { - } - - @Deprecated("This function is deprecated", level = DeprecationLevel.ERROR) - actual fun deprecatedFunctionWithCustomizedAnnotation4() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("")) - actual fun deprecatedFunctionWithCustomizedAnnotation5() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("")) - actual fun deprecatedFunctionWithCustomizedAnnotation6() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = emptyArray())) - actual fun deprecatedFunctionWithCustomizedAnnotation7() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = emptyArray())) - actual fun deprecatedFunctionWithCustomizedAnnotation8() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = emptyArray())) - actual fun deprecatedFunctionWithCustomizedAnnotation9() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()")) - actual fun deprecatedFunctionWithCustomizedAnnotation10() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()")) - actual fun deprecatedFunctionWithCustomizedAnnotation11() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()")) - actual fun deprecatedFunctionWithCustomizedAnnotation12() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation13() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation14() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation15() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation16() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation17() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation18() { - } - - @Deprecated("This function is deprecated", replaceWith = ReplaceWith("foo()", imports = arrayOf("org.sample.foo"))) - actual fun deprecatedFunctionWithCustomizedAnnotation19() { - } - - actual fun nonDeprecatedFunction1() {} - fun nonDeprecatedFunction3() {} -} diff --git a/native/commonizer/testData/functionCommonization/overloadingByUpperBounds/commonized/js/package_root.kt b/native/commonizer/testData/functionCommonization/overloadingByUpperBounds/commonized/js/package_root.kt deleted file mode 100644 index 281165d3e82..00000000000 --- a/native/commonizer/testData/functionCommonization/overloadingByUpperBounds/commonized/js/package_root.kt +++ /dev/null @@ -1,45 +0,0 @@ -actual interface I1 -actual interface I2 -actual interface I3 - -actual fun functionWithValueParameter(value: T) = Unit -actual fun functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun functionWithValueParameter(value: T) = Unit -actual fun functionWithValueParameter(value: T) = Unit -actual fun functionWithValueParameter(value: I1) = Unit -actual fun functionWithValueParameter(value: I2) = Unit -actual fun functionWithValueParameter(value: Any) = Unit -actual fun functionWithValueParameter(value: Any?) = Unit -actual fun functionWithValueParameter() = Unit - -actual fun T.functionWithReceiver() = Unit -actual fun T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun T.functionWithReceiver() = Unit -actual fun T.functionWithReceiver() = Unit -actual fun I1.functionWithReceiver() = Unit -actual fun I2.functionWithReceiver() = Unit -actual fun Any.functionWithReceiver() = Unit -actual fun Any?.functionWithReceiver() = Unit -actual fun functionWithReceiver() = Unit diff --git a/native/commonizer/testData/functionCommonization/overloadingByUpperBounds/commonized/jvm/package_root.kt b/native/commonizer/testData/functionCommonization/overloadingByUpperBounds/commonized/jvm/package_root.kt deleted file mode 100644 index 281165d3e82..00000000000 --- a/native/commonizer/testData/functionCommonization/overloadingByUpperBounds/commonized/jvm/package_root.kt +++ /dev/null @@ -1,45 +0,0 @@ -actual interface I1 -actual interface I2 -actual interface I3 - -actual fun functionWithValueParameter(value: T) = Unit -actual fun functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun > functionWithValueParameter(value: T) = Unit -actual fun functionWithValueParameter(value: T) = Unit -actual fun functionWithValueParameter(value: T) = Unit -actual fun functionWithValueParameter(value: I1) = Unit -actual fun functionWithValueParameter(value: I2) = Unit -actual fun functionWithValueParameter(value: Any) = Unit -actual fun functionWithValueParameter(value: Any?) = Unit -actual fun functionWithValueParameter() = Unit - -actual fun T.functionWithReceiver() = Unit -actual fun T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun > T.functionWithReceiver() = Unit -actual fun T.functionWithReceiver() = Unit -actual fun T.functionWithReceiver() = Unit -actual fun I1.functionWithReceiver() = Unit -actual fun I2.functionWithReceiver() = Unit -actual fun Any.functionWithReceiver() = Unit -actual fun Any?.functionWithReceiver() = Unit -actual fun functionWithReceiver() = Unit diff --git a/native/commonizer/testData/functionCommonization/signaturesWithNullableTypealiases/commonized/js/package_root.kt b/native/commonizer/testData/functionCommonization/signaturesWithNullableTypealiases/commonized/js/package_root.kt deleted file mode 100644 index d0e50560108..00000000000 --- a/native/commonizer/testData/functionCommonization/signaturesWithNullableTypealiases/commonized/js/package_root.kt +++ /dev/null @@ -1,3 +0,0 @@ -actual class Foo actual constructor() - -actual fun bar(x: TypeAlias?) {} diff --git a/native/commonizer/testData/functionCommonization/signaturesWithNullableTypealiases/commonized/jvm/package_root.kt b/native/commonizer/testData/functionCommonization/signaturesWithNullableTypealiases/commonized/jvm/package_root.kt deleted file mode 100644 index d0e50560108..00000000000 --- a/native/commonizer/testData/functionCommonization/signaturesWithNullableTypealiases/commonized/jvm/package_root.kt +++ /dev/null @@ -1,3 +0,0 @@ -actual class Foo actual constructor() - -actual fun bar(x: TypeAlias?) {} diff --git a/native/commonizer/testData/functionCommonization/specifics/commonized/js/package_root.kt b/native/commonizer/testData/functionCommonization/specifics/commonized/js/package_root.kt deleted file mode 100644 index b4d1d29b05b..00000000000 --- a/native/commonizer/testData/functionCommonization/specifics/commonized/js/package_root.kt +++ /dev/null @@ -1,19 +0,0 @@ -actual suspend fun suspendFunction1() = 1 -suspend fun suspendFunction2() = 1 - -actual class Qux actual constructor() - -actual operator fun Qux.get(index: Int) = "$index" -actual operator fun Qux.set(index: Int, value: String) = Unit - -actual infix fun Qux.infixFunction1(another: Qux) {} -actual infix fun Qux.infixFunction2(another: Qux) {} - -actual tailrec fun tailrecFunction1() {} -actual tailrec fun tailrecFunction2() {} - -actual external fun externalFunction1() -actual external fun externalFunction2() - -actual inline fun inlineFunction1() {} -actual inline fun inlineFunction2() {} diff --git a/native/commonizer/testData/functionCommonization/specifics/commonized/jvm/package_root.kt b/native/commonizer/testData/functionCommonization/specifics/commonized/jvm/package_root.kt deleted file mode 100644 index 9559cf2288a..00000000000 --- a/native/commonizer/testData/functionCommonization/specifics/commonized/jvm/package_root.kt +++ /dev/null @@ -1,19 +0,0 @@ -actual suspend fun suspendFunction1() = 1 -fun suspendFunction2() = 1 - -actual class Qux actual constructor() - -actual operator fun Qux.get(index: Int) = "$index" -actual fun Qux.set(index: Int, value: String) = Unit - -actual infix fun Qux.infixFunction1(another: Qux) {} -actual fun Qux.infixFunction2(another: Qux) {} - -actual tailrec fun tailrecFunction1() {} -actual fun tailrecFunction2() {} - -actual external fun externalFunction1() -actual fun externalFunction2() {} - -actual inline fun inlineFunction1() {} -actual fun inlineFunction2() {} diff --git a/native/commonizer/testData/functionCommonization/valueParameters/commonized/ios/package_root.kt b/native/commonizer/testData/functionCommonization/valueParameters/commonized/ios/package_root.kt deleted file mode 100644 index 0ab107a4388..00000000000 --- a/native/commonizer/testData/functionCommonization/valueParameters/commonized/ios/package_root.kt +++ /dev/null @@ -1,169 +0,0 @@ -actual fun functionNoParameters() {} -actual fun functionSingleParameter(i: Int) {} -actual fun functionTwoParameters(i: Int, s: String) {} -actual fun functionThreeParameters(i: Int, s: String, l: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames1(arg0: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames2(arg0: Int, arg1: String) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames3(arg0: Int, arg1: String) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames4(arg0: Int, arg1: String) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames5(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames6(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames7(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames8(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames9(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames10(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames11(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames12(vararg variadicArguments: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames13(arg0: Int, vararg variadicArguments: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames14(arg0: Int, vararg variadicArguments: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames15(arg0: Int, vararg variadicArguments: Int) {} - -actual fun functionMismatchedParameterNames16(i: Int) {} -actual fun functionMismatchedParameterNames17(i: Int, s: String) {} -actual fun functionMismatchedParameterNames18(i: Int, s: String, l: List) {} -actual fun functionMismatchedParameterNames19(vararg v: Int) {} -actual fun functionMismatchedParameterNames20(i: Int, vararg v: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames21(i: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames22(i: Int, s: String) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames23(i: Int, s: String, l: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames24(vararg v: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames25(i: Int, vararg v: Int) {} - -actual fun functionMismatchedParameterNames26(arg0: Int) {} -actual fun functionMismatchedParameterNames27(arg0: Int, arg1: String) {} -actual fun functionMismatchedParameterNames28(arg0: Int, arg1: String, arg2: List) {} -actual fun functionMismatchedParameterNames29(vararg variadicArguments: Int) {} -actual fun functionMismatchedParameterNames30(arg0: Int, vararg variadicArguments: Int) {} - -actual fun functionMismatchedParameterNames31(i: Int, s: String) {} - -@kotlinx.cinterop.ObjCMethod -fun functionMismatchedParameterNames32(i: Int, s: String) { -} - -fun functionMismatchedParameterNames33(i: Int, s: String) {} - -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames34(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -fun functionMismatchedParameterNames35(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -fun functionMismatchedParameterNames36(arg0: Int, arg1: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames37(arg0: Int, arg1: String) { -} - -// hasStableParameterNames=false -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames38(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames39(i: Int, s: String) { -} - -// hasStableParameterNames=false -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames40(i: Int, s: String) { -} - -// hasStableParameterNames=false -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames41(arg0: Int, arg1: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames42(arg0: Int, arg1: String) { -} - -// hasStableParameterNames=false -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames43(arg0: Int, arg1: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun overloadedFunctionByParameterNames(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun overloadedFunctionByParameterNames(xi: Int, xs: String) { -} - -fun functionMismatchedParameterCount1(i: Int, s: String) {} -fun functionMismatchedParameterCount2(i: Int, s: String, l: List) {} - -fun functionMismatchedParameterTypes1(i: Int, s: String) {} -fun functionMismatchedParameterTypes2(i: Int, s: String) {} - -fun functionDefaultValues1(i: Int = 1, s: String) {} -fun functionDefaultValues2(i: Int, s: String = "hello") {} - -actual inline fun inlineFunction1(lazyMessage: () -> String) {} -actual inline fun inlineFunction2(lazyMessage: () -> String) {} -actual inline fun inlineFunction3(crossinline lazyMessage: () -> String) {} -actual inline fun inlineFunction4(lazyMessage: () -> String) {} -actual inline fun inlineFunction5(noinline lazyMessage: () -> String) {} - -actual fun functionWithVararg1(vararg numbers: Int) {} -fun functionWithVararg2(vararg numbers: Int) {} -fun functionWithVararg3(vararg numbers: Int) {} -fun functionWithVararg4(numbers: Array) {} -actual fun functionWithVararg5(numbers: Array) {} -actual fun functionWithVararg6(vararg names: String) {} -fun functionWithVararg7(vararg names: String) {} -fun functionWithVararg8(vararg names: String) {} -fun functionWithVararg9(names: Array) {} -actual fun functionWithVararg10(names: Array) {} - -actual fun functionWithTypeParameters1(p1: T, p2: String) {} -fun functionWithTypeParameters2(p1: T, p2: String) {} -fun functionWithTypeParameters3(p1: T, p2: String) {} -actual fun functionWithTypeParameters4(p1: Q, p2: R) {} -fun functionWithTypeParameters5(p1: Q, p2: R) {} -fun functionWithTypeParameters6(p1: Q, p2: R) {} diff --git a/native/commonizer/testData/functionCommonization/valueParameters/commonized/macos/package_root.kt b/native/commonizer/testData/functionCommonization/valueParameters/commonized/macos/package_root.kt deleted file mode 100644 index 834ff626d95..00000000000 --- a/native/commonizer/testData/functionCommonization/valueParameters/commonized/macos/package_root.kt +++ /dev/null @@ -1,168 +0,0 @@ -actual fun functionNoParameters() {} -actual fun functionSingleParameter(i: Int) {} -actual fun functionTwoParameters(i: Int, s: String) {} -actual fun functionThreeParameters(i: Int, s: String, l: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames1(arg0: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames2(arg0: Int, arg1: String) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames3(arg0: Int, arg1: String) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames4(arg0: Int, arg1: String) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames5(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames6(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames7(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames8(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames9(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames10(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames11(arg0: Int, arg1: String, arg2: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames12(vararg variadicArguments: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames13(arg0: Int, vararg variadicArguments: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames14(arg0: Int, vararg variadicArguments: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames15(arg0: Int, vararg variadicArguments: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames16(i: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames17(i: Int, s: String) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames18(i: Int, s: String, l: List) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames19(vararg v: Int) {} - -// hasStableParameterNames=false -actual fun functionMismatchedParameterNames20(i: Int, vararg v: Int) {} - -actual fun functionMismatchedParameterNames21(i: Int) {} -actual fun functionMismatchedParameterNames22(i: Int, s: String) {} -actual fun functionMismatchedParameterNames23(i: Int, s: String, l: List) {} -actual fun functionMismatchedParameterNames24(vararg v: Int) {} -actual fun functionMismatchedParameterNames25(i: Int, vararg v: Int) {} - -actual fun functionMismatchedParameterNames26(arg0: Int) {} -actual fun functionMismatchedParameterNames27(arg0: Int, arg1: String) {} -actual fun functionMismatchedParameterNames28(arg0: Int, arg1: String, arg2: List) {} -actual fun functionMismatchedParameterNames29(vararg variadicArguments: Int) {} -actual fun functionMismatchedParameterNames30(arg0: Int, vararg variadicArguments: Int) {} - -actual fun functionMismatchedParameterNames31(i: Int, s: String) {} -fun functionMismatchedParameterNames32(i: Int, s: String) {} - -@kotlinx.cinterop.ObjCMethod -fun functionMismatchedParameterNames33(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames34(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -fun functionMismatchedParameterNames35(arg0: Int, arg1: String) { -} - -@kotlinx.cinterop.ObjCMethod -fun functionMismatchedParameterNames36(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames37(arg0: Int, arg1: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames38(i: Int, s: String) { -} - -// hasStableParameterNames=false -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames39(i: Int, s: String) { -} - -// hasStableParameterNames=false -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames40(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames41(arg0: Int, arg1: String) { -} - -// hasStableParameterNames=false -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames42(arg0: Int, arg1: String) { -} - -// hasStableParameterNames=false -@kotlinx.cinterop.ObjCMethod -actual fun functionMismatchedParameterNames43(arg0: Int, arg1: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun overloadedFunctionByParameterNames(i: Int, s: String) { -} - -@kotlinx.cinterop.ObjCMethod -actual fun overloadedFunctionByParameterNames(xi: Int, xs: String) { -} - -fun functionMismatchedParameterCount1(i: Int, s: String, l: List) {} -fun functionMismatchedParameterCount2(i: Int, s: String) {} - -fun functionMismatchedParameterTypes1(i: Short, s: String) {} -fun functionMismatchedParameterTypes2(i: Int, s: CharSequence) {} - -fun functionDefaultValues1(i: Int = 1, s: String) {} -fun functionDefaultValues2(i: Int, s: String = "hello") {} - -actual inline fun inlineFunction1(lazyMessage: () -> String) {} -actual inline fun inlineFunction2(crossinline lazyMessage: () -> String) {} -actual inline fun inlineFunction3(crossinline lazyMessage: () -> String) {} -actual inline fun inlineFunction4(noinline lazyMessage: () -> String) {} -actual inline fun inlineFunction5(noinline lazyMessage: () -> String) {} - -actual fun functionWithVararg1(vararg numbers: Int) {} -fun functionWithVararg2(numbers: Array) {} -fun functionWithVararg3(numbers: Array) {} -fun functionWithVararg4(numbers: Array) {} -actual fun functionWithVararg5(numbers: Array) {} -actual fun functionWithVararg6(vararg names: String) {} -fun functionWithVararg7(names: Array) {} -fun functionWithVararg8(names: Array) {} -fun functionWithVararg9(names: Array) {} -actual fun functionWithVararg10(names: Array) {} - -actual fun functionWithTypeParameters1(p1: T, p2: String) {} -fun functionWithTypeParameters2(p1: String, p2: String) {} -fun functionWithTypeParameters2(p1: String, p2: T) {} -actual fun functionWithTypeParameters4(p1: Q, p2: R) {} -fun functionWithTypeParameters5(p1: Q, p2: R) {} -fun functionWithTypeParameters6(p1: R, p2: Q) {} diff --git a/native/commonizer/testData/generalCommonization/annotations/commonized/js/package_root.kt b/native/commonizer/testData/generalCommonization/annotations/commonized/js/package_root.kt deleted file mode 100644 index 6f1ea0fde51..00000000000 --- a/native/commonizer/testData/generalCommonization/annotations/commonized/js/package_root.kt +++ /dev/null @@ -1,66 +0,0 @@ -import kotlin.annotation.AnnotationTarget.* - -@Target(ANNOTATION_CLASS) -actual annotation class CommonAnnotationForAnnotationClassesOnly actual constructor(actual val text: String) - -@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE) -@JsAnnotationForAnnotationClassesOnly("annotation-class") -@CommonAnnotationForAnnotationClassesOnly("annotation-class") -actual annotation class CommonAnnotation actual constructor(actual val text: String) - -@Target(ANNOTATION_CLASS) -annotation class JsAnnotationForAnnotationClassesOnly(val text: String) - -@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE) -@JsAnnotationForAnnotationClassesOnly("annotation-class") -@CommonAnnotationForAnnotationClassesOnly("annotation-class") -annotation class JsAnnotation(val text: String) - -@JsAnnotation("property") -@CommonAnnotation("property") -actual var propertyWithoutBackingField - @JsAnnotation("getter") @CommonAnnotation("getter") get() = 3.14 - @JsAnnotation("setter") @CommonAnnotation("setter") set(@JsAnnotation("parameter") @CommonAnnotation("parameter") value) = Unit - -@field:JsAnnotation("field") -@field:CommonAnnotation("field") -actual val propertyWithBackingField = 3.14 - -@delegate:JsAnnotation("field") -@delegate:CommonAnnotation("field") -actual val propertyWithDelegateField: Int by lazy { 42 } - -actual val < - @JsAnnotation("type-parameter") - @CommonAnnotation("type-parameter") - T : CharSequence> - @receiver:JsAnnotation("receiver") - @receiver:CommonAnnotation("receiver") - T.propertyWithExtensionReceiver: Int - get() = length - -@JsAnnotation("function") -@CommonAnnotation("function") -actual fun function1(@JsAnnotation("parameter") @CommonAnnotation("parameter") text: String) = text - -@JsAnnotation("function") -@CommonAnnotation("function") -actual fun < - @JsAnnotation("type-parameter") - @CommonAnnotation("type-parameter") - Q : Number> - @receiver:JsAnnotation("receiver") - @receiver:CommonAnnotation("receiver") - Q.function2(): Q = this - -@JsAnnotation("class") -@CommonAnnotation("class") -actual class AnnotatedClass @JsAnnotation("constructor") @CommonAnnotation("constructor") actual constructor(actual val value: String) - -@JsAnnotation("js-only-class") -@CommonAnnotation("js-only-class") -class JsOnlyAnnotatedClass @JsAnnotation("js-only-constructor") @CommonAnnotation("js-only-constructor") constructor(val value: String) - -@JsAnnotation("non-lifted-up-type-alias") -@CommonAnnotation("non-lifted-up-type-alias") -actual typealias AnnotatedNonLiftedUpTypeAlias = JsOnlyAnnotatedClass diff --git a/native/commonizer/testData/generalCommonization/annotations/commonized/jvm/package_root.kt b/native/commonizer/testData/generalCommonization/annotations/commonized/jvm/package_root.kt deleted file mode 100644 index aca6a394c7f..00000000000 --- a/native/commonizer/testData/generalCommonization/annotations/commonized/jvm/package_root.kt +++ /dev/null @@ -1,66 +0,0 @@ -import kotlin.annotation.AnnotationTarget.* - -@Target(ANNOTATION_CLASS) -actual annotation class CommonAnnotationForAnnotationClassesOnly actual constructor(actual val text: String) - -@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE) -@JvmAnnotationForAnnotationClassesOnly("annotation-class") -@CommonAnnotationForAnnotationClassesOnly("annotation-class") -actual annotation class CommonAnnotation actual constructor(actual val text: String) - -@Target(ANNOTATION_CLASS) -annotation class JvmAnnotationForAnnotationClassesOnly(val text: String) - -@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE) -@JvmAnnotationForAnnotationClassesOnly("annotation-class") -@CommonAnnotationForAnnotationClassesOnly("annotation-class") -annotation class JvmAnnotation(val text: String) - -@JvmAnnotation("property") -@CommonAnnotation("property") -actual var propertyWithoutBackingField - @JvmAnnotation("getter") @CommonAnnotation("getter") get() = 3.14 - @JvmAnnotation("setter") @CommonAnnotation("setter") set(@JvmAnnotation("parameter") @CommonAnnotation("parameter") value) = Unit - -@field:JvmAnnotation("field") -@field:CommonAnnotation("field") -actual val propertyWithBackingField = 3.14 - -@delegate:JvmAnnotation("field") -@delegate:CommonAnnotation("field") -actual val propertyWithDelegateField: Int by lazy { 42 } - -actual val < - @JvmAnnotation("type-parameter") - @CommonAnnotation("type-parameter") - T : CharSequence> - @receiver:JvmAnnotation("receiver") - @receiver:CommonAnnotation("receiver") - T.propertyWithExtensionReceiver: Int - get() = length - -@JvmAnnotation("function") -@CommonAnnotation("function") -actual fun function1(@JvmAnnotation("parameter") @CommonAnnotation("parameter") text: String) = text - -@JvmAnnotation("function") -@CommonAnnotation("function") -actual fun < - @JvmAnnotation("type-parameter") - @CommonAnnotation("type-parameter") - Q : Number> - @receiver:JvmAnnotation("receiver") - @receiver:CommonAnnotation("receiver") - Q.function2(): Q = this - -@JvmAnnotation("class") -@CommonAnnotation("class") -actual class AnnotatedClass @JvmAnnotation("constructor") @CommonAnnotation("constructor") actual constructor(actual val value: String) - -@JvmAnnotation("jvm-only-class") -@CommonAnnotation("jvm-only-class") -class JvmOnlyAnnotatedClass @JvmAnnotation("jvm-only-constructor") @CommonAnnotation("jvm-only-constructor") constructor(val value: String) - -@JvmAnnotation("non-lifted-up-type-alias") -@CommonAnnotation("non-lifted-up-type-alias") -actual typealias AnnotatedNonLiftedUpTypeAlias = JvmOnlyAnnotatedClass diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample.kt deleted file mode 100644 index 8bd2f81f498..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.sample - -val bar = 1 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample_one.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample_one.kt deleted file mode 100644 index ed9770389d6..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample_one.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.sample.one - -val baz = 1 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample_two.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample_two.kt deleted file mode 100644 index bc6c512c351..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_org_sample_two.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.sample.two - -actual val qux = 1 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_root.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_root.kt deleted file mode 100644 index 321d96efbb4..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/js/package_root.kt +++ /dev/null @@ -1,5 +0,0 @@ -actual val foo = 1 - -val jsSpecificProperty = 42 -val jsAndJvmSpecificProperty = 42 * 2 -val jsAndNativeSpecificProperty = 42 * 3 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_org_sample.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_org_sample.kt deleted file mode 100644 index 8bd2f81f498..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_org_sample.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.sample - -val bar = 1 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_org_sample_two.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_org_sample_two.kt deleted file mode 100644 index bc6c512c351..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_org_sample_two.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.sample.two - -actual val qux = 1 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_root.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_root.kt deleted file mode 100644 index 847af755cc4..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/jvm/package_root.kt +++ /dev/null @@ -1,5 +0,0 @@ -actual val foo = 1 - -val jvmSpecificProperty = 42 -val jsAndJvmSpecificProperty = 42 * 2 -val jvmAndNativeSpecificProperty = 42 * 4 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_org_sample_one.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_org_sample_one.kt deleted file mode 100644 index ed9770389d6..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_org_sample_one.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.sample.one - -val baz = 1 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_org_sample_two.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_org_sample_two.kt deleted file mode 100644 index bc6c512c351..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_org_sample_two.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.sample.two - -actual val qux = 1 diff --git a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_root.kt b/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_root.kt deleted file mode 100644 index 5c199fdc8ec..00000000000 --- a/native/commonizer/testData/generalCommonization/mismatchedPackages/commonized/native/package_root.kt +++ /dev/null @@ -1,5 +0,0 @@ -actual val foo = 1 - -val nativeSpecificProperty = 42 -val jsAndNativeSpecificProperty = 42 * 3 -val jvmAndNativeSpecificProperty = 42 * 4 diff --git a/native/commonizer/testData/propertyCommonization/liftingUpConst/commonized/js/package_root.kt b/native/commonizer/testData/propertyCommonization/liftingUpConst/commonized/js/package_root.kt deleted file mode 100644 index a16585e9dbf..00000000000 --- a/native/commonizer/testData/propertyCommonization/liftingUpConst/commonized/js/package_root.kt +++ /dev/null @@ -1,22 +0,0 @@ -const val property2 = 42 -val property3 = 42 // intentionally left as non-const -actual val property4 = 42 - -actual val property6: Byte = 42 -actual val property8: Short = 42 -actual val property10: Long = 42 -actual val property12: Double = 4.2 -actual val property14: Float = 4.2f -actual val property16 = true -actual val property18 = "42" -actual val property20: Char = 42.toChar() - -const val property21: Byte = 42 -const val property22: Short = 42 -const val property23: Int = 42 -const val property24: Long = 42 -const val property25: Double = 4.2 -const val property26: Float = 4.2f -const val property27 = true -const val property28 = "42" -const val property29: Char = 42.toChar() diff --git a/native/commonizer/testData/propertyCommonization/liftingUpConst/commonized/jvm/package_root.kt b/native/commonizer/testData/propertyCommonization/liftingUpConst/commonized/jvm/package_root.kt deleted file mode 100644 index c2c40ded57b..00000000000 --- a/native/commonizer/testData/propertyCommonization/liftingUpConst/commonized/jvm/package_root.kt +++ /dev/null @@ -1,22 +0,0 @@ -val property2 = 42 // intentionally left as non-const -const val property3 = 42 -actual val property4 = 42 - -actual val property6: Byte = 142 -actual val property8: Short = 142 -actual val property10: Long = 142 -actual val property12: Double = 14.2 -actual val property14: Float = 14.2f -actual val property16 = false -actual val property18 = "142" -actual val property20: Char = 142.toChar() - -const val property21: Char = 42.toChar() -const val property22: Byte = 42 -const val property23: Short = 42 -const val property24: Int = 42 -const val property25: Long = 42 -const val property26: Double = 4.2 -const val property27: Float = 4.2f -const val property28 = true -const val property29 = "42" diff --git a/native/commonizer/testData/propertyCommonization/overloadingByUpperBounds/commonized/js/package_root.kt b/native/commonizer/testData/propertyCommonization/overloadingByUpperBounds/commonized/js/package_root.kt deleted file mode 100644 index 0661c51fd5f..00000000000 --- a/native/commonizer/testData/propertyCommonization/overloadingByUpperBounds/commonized/js/package_root.kt +++ /dev/null @@ -1,26 +0,0 @@ -actual interface I1 -actual interface I2 -actual interface I3 - -actual object Holder { - actual val T.propertyWithReceiver: Unit get() = Unit - actual val T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val T.propertyWithReceiver: Unit get() = Unit - actual val T.propertyWithReceiver: Unit get() = Unit - actual val I1.propertyWithReceiver: Unit get() = Unit - actual val I2.propertyWithReceiver: Unit get() = Unit - actual val Any.propertyWithReceiver: Unit get() = Unit - actual val Any?.propertyWithReceiver: Unit get() = Unit - actual val propertyWithReceiver: Unit get() = Unit -} diff --git a/native/commonizer/testData/propertyCommonization/overloadingByUpperBounds/commonized/jvm/package_root.kt b/native/commonizer/testData/propertyCommonization/overloadingByUpperBounds/commonized/jvm/package_root.kt deleted file mode 100644 index 0661c51fd5f..00000000000 --- a/native/commonizer/testData/propertyCommonization/overloadingByUpperBounds/commonized/jvm/package_root.kt +++ /dev/null @@ -1,26 +0,0 @@ -actual interface I1 -actual interface I2 -actual interface I3 - -actual object Holder { - actual val T.propertyWithReceiver: Unit get() = Unit - actual val T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val > T.propertyWithReceiver: Unit get() = Unit - actual val T.propertyWithReceiver: Unit get() = Unit - actual val T.propertyWithReceiver: Unit get() = Unit - actual val I1.propertyWithReceiver: Unit get() = Unit - actual val I2.propertyWithReceiver: Unit get() = Unit - actual val Any.propertyWithReceiver: Unit get() = Unit - actual val Any?.propertyWithReceiver: Unit get() = Unit - actual val propertyWithReceiver: Unit get() = Unit -} diff --git a/native/commonizer/testData/propertyCommonization/setters/commonized/js/package_root.kt b/native/commonizer/testData/propertyCommonization/setters/commonized/js/package_root.kt deleted file mode 100644 index 3789cb1e727..00000000000 --- a/native/commonizer/testData/propertyCommonization/setters/commonized/js/package_root.kt +++ /dev/null @@ -1,30 +0,0 @@ -actual var defaultSetter1 = 42 -actual var defaultSetter2 = 42 - set -actual var defaultSetter3 = 42 - set - -actual var setterWithoutBackingField1 - get() = 42 - set(value) = Unit -actual var setterWithoutBackingField2 - get() = 42 - set(value) = Unit - -actual var setterWithDelegation1: Int by mutableMapOf("setterWithDelegation1" to 42) -actual var setterWithDelegation2: Int by mutableMapOf("setterWithDelegation2" to 42) - -actual var defaultSetteCustomVisibility1 = 42 - public set -var defaultSetteCustomVisibility2 = 42 - internal set -actual var defaultSetteCustomVisibility3 = 42 - internal set -var defaultSetteCustomVisibility4 = 42 - private set -var defaultSetteCustomVisibility5 = 42 - private set - -actual val propertyWithoutSetter = 42 -var propertyMaybeSetter = 42 -actual var propertyWithSetter = 42 diff --git a/native/commonizer/testData/propertyCommonization/setters/commonized/jvm/package_root.kt b/native/commonizer/testData/propertyCommonization/setters/commonized/jvm/package_root.kt deleted file mode 100644 index 29dfc7099ba..00000000000 --- a/native/commonizer/testData/propertyCommonization/setters/commonized/jvm/package_root.kt +++ /dev/null @@ -1,27 +0,0 @@ -actual var defaultSetter1 = 42 -actual var defaultSetter2 = 42 -actual var defaultSetter3 = 42 - set - -actual var setterWithoutBackingField1 - get() = 42 - set(value) = Unit -actual var setterWithoutBackingField2 = 42 - -actual var setterWithDelegation1: Int by mutableMapOf("setterWithDelegation1" to 42) -actual var setterWithDelegation2 = 42 - -actual var defaultSetteCustomVisibility1 = 42 - public set -var defaultSetteCustomVisibility2 = 42 - public set -actual var defaultSetteCustomVisibility3 = 42 - internal set -var defaultSetteCustomVisibility4 = 42 - internal set -var defaultSetteCustomVisibility5 = 42 - private set - -actual val propertyWithoutSetter = 42 -val propertyMaybeSetter = 42 -actual var propertyWithSetter = 42 diff --git a/native/commonizer/testData/propertyCommonization/specifics/commonized/js/package_root.kt b/native/commonizer/testData/propertyCommonization/specifics/commonized/js/package_root.kt deleted file mode 100644 index f7837539c6a..00000000000 --- a/native/commonizer/testData/propertyCommonization/specifics/commonized/js/package_root.kt +++ /dev/null @@ -1,30 +0,0 @@ -actual val delegatedProperty1: Int by lazy { 42 } -actual val delegatedProperty2: Int by lazy { 42 } -actual val delegatedProperty3: Int by mapOf("delegatedProperty3" to 42) -actual val delegatedProperty4: Int by mapOf("delegatedProperty4" to 42) - -lateinit var lateinitProperty1: String -lateinit var lateinitProperty2: String - -actual inline val inlineProperty1 get() = 42 -actual inline val inlineProperty2 get() = 42 -actual inline val inlineProperty3 get() = 42 - -actual inline var inlineProperty4 - get() = 42 - set(value) = Unit -actual inline var inlineProperty5 - get() = 42 - set(value) = Unit -actual inline var inlineProperty6 - get() = 42 - set(value) = Unit -actual inline var inlineProperty7 - get() = 42 - set(value) = Unit -actual inline var inlineProperty8 - get() = 42 - set(value) = Unit - -actual external val externalProperty1: Int -actual external val externalProperty2: Int diff --git a/native/commonizer/testData/propertyCommonization/specifics/commonized/jvm/package_root.kt b/native/commonizer/testData/propertyCommonization/specifics/commonized/jvm/package_root.kt deleted file mode 100644 index 964e5a6a73a..00000000000 --- a/native/commonizer/testData/propertyCommonization/specifics/commonized/jvm/package_root.kt +++ /dev/null @@ -1,30 +0,0 @@ -actual val delegatedProperty1: Int by lazy { 42 } -actual val delegatedProperty2 = 42 // intentionally left as non-delegated -actual val delegatedProperty3: Int by mapOf("delegatedProperty3" to 42) -actual val delegatedProperty4 = 42 // intentionally left as non-delegated - -lateinit var lateinitProperty1: String -var lateinitProperty2 = "hello" // intentionally left as non-lateinit - -actual val inlineProperty1 inline get() = 42 -actual inline val inlineProperty2 get() = 42 -actual val inlineProperty3 = 42 // intentionally left as non-inline - -actual var inlineProperty4 - inline get() = 42 - inline set(value) = Unit -inline actual var inlineProperty5 - get() = 42 - set(value) = Unit -actual var inlineProperty6 - inline get() = 42 - set(value) = Unit -actual var inlineProperty7 - get() = 42 - inline set(value) = Unit -actual var inlineProperty8 - get() = 42 - set(value) = Unit - -actual external val externalProperty1: Int -actual val externalProperty2: Int = 1 diff --git a/native/commonizer/tests/org/jetbrains/kotlin/commonizer/AbstractCommonizationFromSourcesTest.kt b/native/commonizer/tests/org/jetbrains/kotlin/commonizer/AbstractCommonizationFromSourcesTest.kt index d66a5dd8c96..333bf1221c2 100644 --- a/native/commonizer/tests/org/jetbrains/kotlin/commonizer/AbstractCommonizationFromSourcesTest.kt +++ b/native/commonizer/tests/org/jetbrains/kotlin/commonizer/AbstractCommonizationFromSourcesTest.kt @@ -124,7 +124,7 @@ private class SourceModuleRoots( check(sharedTarget.targets == leafTargets) val allTargets = leafTargets + sharedTarget - check(commonizedRoots.keys == allTargets) + check(commonizedRoots.keys.single() == sharedTarget) check(allTargets.containsAll(dependencyRoots.keys)) } @@ -189,7 +189,7 @@ private class AnalyzedModules( sharedTarget = SharedCommonizerTarget(leafTargets) val allTargets = leafTargets + sharedTarget - check(commonizedModules.keys == allTargets) + check(commonizedModules.keys.single() == sharedTarget) check(allTargets.containsAll(dependencyModules.keys)) }