From 8cf9c66b1b2d9a7febc8c8f889276e33ba5e3ee6 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 7 Sep 2018 20:02:30 +0300 Subject: [PATCH] MPP: make platformByCompilerArguments a bit safer Original commit: 5e3fd189a499aae69f055ae59bd8e243ef98948c --- .../src/org/jetbrains/kotlin/platform/IdePlatformKind.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 e4315c5c527..395db967918 100644 --- a/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt +++ b/jps/jps-common/src/org/jetbrains/kotlin/platform/IdePlatformKind.kt @@ -51,9 +51,8 @@ abstract class IdePlatformKind> { val IDE_PLATFORMS_BY_COMPILER_PLATFORMS by lazy { ALL_KINDS.map { it.compilerPlatform to it }.toMap() } - fun platformByCompilerArguments(arguments: Args): IdePlatform<*, Args> { - return ALL_KINDS.firstNotNullResult { it.platformByCompilerArguments(arguments) as IdePlatform<*, Args>? }!! - } + fun platformByCompilerArguments(arguments: Args): IdePlatform<*, *>? = + ALL_KINDS.firstNotNullResult { it.platformByCompilerArguments(arguments) } } }