From 779a5c40c0b4548c5b6828820e3ceccf5cdfc2c4 Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Wed, 6 Oct 2021 15:26:28 +0200 Subject: [PATCH] [CHERRY PICKED FROM IJ] [refactoring] IdePlatformKind: remove unnecessary generic parameter It seems that it's not used anymore after 82906a0f35ea13673a8a3b3bfaee94a568eff215 GitOrigin-RevId: 229d3b0573873c2da661712f6fce194816436ca7 Original commit: https://github.com/JetBrains/intellij-community/commit/70e4b14a5a37b8d591df2663725fd1d2c6881628 --- .../kotlin/platform/DefaultIdeTargetPlatformKindProvider.kt | 2 +- .../src/org/jetbrains/kotlin/platform/IdePlatform.kt | 2 +- .../src/org/jetbrains/kotlin/platform/IdePlatformKind.kt | 4 ++-- .../jetbrains/kotlin/platform/impl/CommonIdePlatformKind.kt | 4 ++-- .../org/jetbrains/kotlin/platform/impl/JsIdePlatformKind.kt | 4 ++-- .../org/jetbrains/kotlin/platform/impl/JvmIdePlatformKind.kt | 4 ++-- .../jetbrains/kotlin/platform/impl/NativeIdePlatformKind.kt | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/jps/jps-common/src/org/jetbrains/kotlin/platform/DefaultIdeTargetPlatformKindProvider.kt b/jps/jps-common/src/org/jetbrains/kotlin/platform/DefaultIdeTargetPlatformKindProvider.kt index 521d31b401f..ed6a037e029 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/DefaultIdeTargetPlatformKindProvider.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/DefaultIdeTargetPlatformKindProvider.kt @@ -29,6 +29,6 @@ fun TargetPlatform?.orDefault(): TargetPlatform { return this ?: DefaultIdeTargetPlatformKindProvider.defaultPlatform } -fun IdePlatformKind<*>?.orDefault(): IdePlatformKind<*> { +fun IdePlatformKind?.orDefault(): IdePlatformKind { return this ?: DefaultIdeTargetPlatformKindProvider.defaultPlatform.idePlatformKind } \ No newline at end of file diff --git a/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatform.kt b/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatform.kt index 03747c37be5..5f08eaf0a7d 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatform.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatform.kt @@ -14,7 +14,7 @@ import org.jetbrains.kotlin.utils.DescriptionAware replaceWith = ReplaceWith("TargetPlatform", "org.jetbrains.kotlin.platform.TargetPlatform"), level = DeprecationLevel.ERROR ) -abstract class IdePlatform, out Arguments : CommonCompilerArguments> : DescriptionAware { +abstract class IdePlatform : DescriptionAware { abstract val kind: Kind abstract val version: TargetPlatformVersion diff --git a/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt b/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt index fe75bbad037..433d0a53eca 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt @@ -17,7 +17,7 @@ import org.jetbrains.kotlin.platform.impl.JvmIdePlatformKind import org.jetbrains.kotlin.platform.impl.NativeIdePlatformKind import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult -abstract class IdePlatformKind> { +abstract class IdePlatformKind { abstract fun supportsTargetPlatform(platform: TargetPlatform): Boolean abstract val defaultPlatform: TargetPlatform @@ -71,7 +71,7 @@ abstract class IdePlatformKind> { } } -val TargetPlatform.idePlatformKind: IdePlatformKind<*> +val TargetPlatform.idePlatformKind: IdePlatformKind get() = IdePlatformKind.ALL_KINDS.filter { it.supportsTargetPlatform(this) }.let { list -> when { list.size == 1 -> list.first() diff --git a/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/CommonIdePlatformKind.kt b/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/CommonIdePlatformKind.kt index 6200b08bc08..936e59f70da 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/CommonIdePlatformKind.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/CommonIdePlatformKind.kt @@ -12,7 +12,7 @@ import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments import org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments import org.jetbrains.kotlin.platform.* -object CommonIdePlatformKind : IdePlatformKind() { +object CommonIdePlatformKind : IdePlatformKind() { override fun supportsTargetPlatform(platform: TargetPlatform) = platform.isCommon() override fun platformByCompilerArguments(arguments: CommonCompilerArguments): TargetPlatform? { @@ -49,7 +49,7 @@ object CommonIdePlatformKind : IdePlatformKind() { } } -val IdePlatformKind<*>?.isCommon +val IdePlatformKind?.isCommon get() = this is CommonIdePlatformKind @Deprecated( diff --git a/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/JsIdePlatformKind.kt b/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/JsIdePlatformKind.kt index 6b145c67ceb..ad27c43abc8 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/JsIdePlatformKind.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/JsIdePlatformKind.kt @@ -17,7 +17,7 @@ import org.jetbrains.kotlin.platform.TargetPlatformVersion import org.jetbrains.kotlin.platform.js.JsPlatforms import org.jetbrains.kotlin.platform.js.isJs -object JsIdePlatformKind : IdePlatformKind() { +object JsIdePlatformKind : IdePlatformKind() { override fun supportsTargetPlatform(platform: TargetPlatform): Boolean = platform.isJs() override fun platformByCompilerArguments(arguments: CommonCompilerArguments): TargetPlatform? { @@ -55,7 +55,7 @@ object JsIdePlatformKind : IdePlatformKind() { } } -val IdePlatformKind<*>?.isJavaScript +val IdePlatformKind?.isJavaScript get() = this is JsIdePlatformKind @Deprecated( diff --git a/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/JvmIdePlatformKind.kt b/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/JvmIdePlatformKind.kt index 378d3da152d..cffdb9a561a 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/JvmIdePlatformKind.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/JvmIdePlatformKind.kt @@ -18,7 +18,7 @@ import org.jetbrains.kotlin.platform.TargetPlatform import org.jetbrains.kotlin.platform.jvm.JvmPlatforms import org.jetbrains.kotlin.platform.jvm.isJvm -object JvmIdePlatformKind : IdePlatformKind() { +object JvmIdePlatformKind : IdePlatformKind() { override fun supportsTargetPlatform(platform: TargetPlatform): Boolean = platform.isJvm() override fun platformByCompilerArguments(arguments: CommonCompilerArguments): TargetPlatform? { @@ -66,7 +66,7 @@ object JvmIdePlatformKind : IdePlatformKind() { } } -val IdePlatformKind<*>?.isJvm +val IdePlatformKind?.isJvm get() = this is JvmIdePlatformKind @Deprecated( diff --git a/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/NativeIdePlatformKind.kt b/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/NativeIdePlatformKind.kt index d6ab4adfa55..28924eaa0d8 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/NativeIdePlatformKind.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/impl/NativeIdePlatformKind.kt @@ -16,7 +16,7 @@ import org.jetbrains.kotlin.platform.TargetPlatformVersion import org.jetbrains.kotlin.platform.konan.NativePlatforms import org.jetbrains.kotlin.platform.konan.isNative -object NativeIdePlatformKind : IdePlatformKind() { +object NativeIdePlatformKind : IdePlatformKind() { override fun supportsTargetPlatform(platform: TargetPlatform): Boolean = platform.isNative() override fun platformByCompilerArguments(arguments: CommonCompilerArguments): TargetPlatform? { @@ -59,7 +59,7 @@ object NativeIdePlatformKind : IdePlatformKind() { // These are fake compiler arguments for Kotlin/Native - only for usage within IDEA plugin: class FakeK2NativeCompilerArguments : CommonCompilerArguments() -val IdePlatformKind<*>?.isKotlinNative +val IdePlatformKind?.isKotlinNative get() = this is NativeIdePlatformKind @Deprecated(