Try to find and inject non-trivial targetPlatformVersion

This is important for composite analysis in multiplatform modules
diff --git a/compiler/frontend/src/org/jetbrains/kotlin/frontend/di/injection.kt b/compiler/frontend/src/org/jetbrains/kotlin/frontend/di/injection.kt
index 9d58569..fb0ab1a 100644
--- a/compiler/frontend/src/org/jetbrains/kotlin/frontend/di/injection.kt
+++ b/compiler/frontend/src/org/jetbrains/kotlin/frontend/di/injection.kt
@@ -56,7 +56,12 @@
 
     useInstance(platform)
     useInstance(analyzerServices)
-    useInstance(platform.componentPlatforms.singleOrNull()?.targetPlatformVersion ?: TargetPlatformVersion.NoVersion)
+
+    val nonTrivialPlatformVersion = platform
+        .mapNotNull { it.targetPlatformVersion.takeIf { it != TargetPlatformVersion.NoVersion } }
+        .singleOrNull()
+
+    useInstance(nonTrivialPlatformVersion ?: TargetPlatformVersion.NoVersion)
 
     analyzerServices.platformConfigurator.configureModuleComponents(this)
     analyzerServices.platformConfigurator.configureModuleDependentCheckers(this)