Do not add JS/JVM libraries to common library dependencies in LibraryDependenciesCache

Currently kotlin-stdlib-common doesn't have serialized built-ins inside,
so in a multiplatform project, it was possible that either JVM or JS
built-ins (depending on the order of entries in the project
configuration) were going to be used for the analysis of a common module
depending on kotlin-stdlib-common. This resulted, for example, in
additional built-in member calls (e.g. "List.stream()") being unresolved
in JVM modules when they used the List instance coming from the common
module (see the added test)
This commit is contained in:
Alexander Udalov
2017-04-14 15:27:53 +03:00
parent 4c2c734733
commit 9a8dc14616
10 changed files with 114 additions and 20 deletions
@@ -0,0 +1,3 @@
package test
fun getEmptyList() = emptyList<String>()
@@ -0,0 +1,6 @@
package test
fun testJs() {
// This is a JavaScript module, so `List.stream` should be unresolved
getEmptyList().<error>stream</error>()
}
@@ -0,0 +1,6 @@
package test
fun testJvm() {
// This is a JVM 8 module, so `List.stream` should be resolved correctly
getEmptyList().stream()
}