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(