Files that contain only a single class are marked ...
# intellij
a
Files that contain only a single class are marked with the lower icon (“Kotlin class”) while other files with the top one (“Kotlin file”). Wouldn’t it make more sense if private top-level declarations would not cause the icon to be “Kotlin file”? So for example, this file would still be counted as a “Kotlin class”:
Copy code
class Foo {
    fun bar(): String = BAZ
}

private const val BAZ = "baz"
8
k
Yes, honestly just the icon discourages me a little but from pulling helper functions out of classes if they don't depend on any state.
a
Turns out there’s already an issue for that https://youtrack.jetbrains.com/issue/KT-25440 @diesieben07 @karelpeeters @kartoffelsup @bogdoll @ribesg Please vote for it if you can 🙂
k
I was looking for an issue earlier too, thanks for actually succeeding simple smile
👍 1
d
I would like to suggest that public extension functions of the same class are also exempted from making the file generic
Same issue as @karelpeeters, its discouraging
a
@Dico makes sense to me, you could put it as a comment in that issue ☝️ BTW, with regard to the practice itself, why is it more preferable to make it a public extension function in the same file, rather than just a public member function of the class?
k