Usability issues with beta-4 package refactoring


#1

I’ve just tried 1.0.0-beta-4583. While the package refactoring definitely makes it easier to find stuff in stdlib, it also hampers usability. To give just one example, for ((key, value) in myMap) now gives hard to understand errors until multiple extension methods from kotlin.collections have been imported, allowing maps to participate in for..in.

Another example is file.walk().filter { ... }, which now gives a strange error about accessing a private field filter, until kotlin.sequences.filter (not kotlin.collections.filter!) is imported. Without the help of an IDE, this feels too hard to figure out, and at least for now, IntelliJ does’t suggest the import after the fact.

As a result, two thirds of my files now contain the line import kotlin.collections.*, and many others import kotlin.text.* or import kotlin.sequences.*. My initial impression is that requiring imports for essential functions such as those found in StringsKt, CollectionsKt, and MapsKt goes too far, and that they should be available by default. Perhaps I’ll change my mind over time, but I thought I’d provide early feedback.

PS: I would have preferred the Java convention of uniformly using singular form for package names (collection, sequence, etc.), but that’s just my preference.


How do I update the Kotlin plugin in IntelliJ 15.0.2?
#2

It is strange. These imports should not be required, as kotlin.collections.*, kotlin.sequences.* etc are imported by default (same as kotlin.*).
I’ll try to reproduce this situation. Meanwhile, can you check whether have you upgraded kotlin plugin?


#3

I just updated the plugin (after getting an update notification), which solved the problem. Glad I can rid of all the imports again. :smile:

PS: Imports such as kotlin.collections.find are not shown as redundant in IntelliJ.