MPP: make platformByCompilerArguments a bit safer

This commit is contained in:
Mikhail Glukhikh
2018-09-07 20:02:30 +03:00
parent 5633d86cb2
commit 5e3fd189a4
@@ -51,9 +51,8 @@ abstract class IdePlatformKind<Kind : IdePlatformKind<Kind>> {
val IDE_PLATFORMS_BY_COMPILER_PLATFORMS by lazy { ALL_KINDS.map { it.compilerPlatform to it }.toMap() }
fun <Args : CommonCompilerArguments> platformByCompilerArguments(arguments: Args): IdePlatform<*, Args> {
return ALL_KINDS.firstNotNullResult { it.platformByCompilerArguments(arguments) as IdePlatform<*, Args>? }!!
}
fun <Args : CommonCompilerArguments> platformByCompilerArguments(arguments: Args): IdePlatform<*, *>? =
ALL_KINDS.firstNotNullResult { it.platformByCompilerArguments(arguments) }
}
}