0

I setup a project only with common / shared code but Idea is telling me that there aren't any implementations for basic Kotlin collections like List, Map and Set.

Why Kotlin doesn't provide those implementations in common code among platforms? Is there any specific reason?

  • What kotlin dependencies have you added to your project? – alexy May 24 '19 at 11:22
  • 1
    They are. E.g. you can see `Common` for [`mutableListOf`][1], for [`ArrayList`][2], etc. In what [1]: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/mutable-list-of.html [2]: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-array-list/index.html – Alexey Romanov May 24 '19 at 12:23
  • I"m not well versed in how Kotlin operates between different platforms, but I'd suspect the _implementations_ of these interfaces would be different between things like the JVM and JavaScript. – Slaw May 24 '19 at 19:43
  • In the Project Structure inside Idea, I left only a Kotlin module using the target platform "Common (experimental)". Then the Idea is telling me that some functions like mutableListOf () are not available. It seems that the implementation for those collections are dependent on Java API ... – user2387273 May 27 '19 at 12:33

0 Answers0