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
karelpeeters
08/20/2019, 9:50 AM
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.
I was looking for an issue earlier too, thanks for actually succeeding simple smile
👍 1
d
Dico
08/28/2019, 8:13 AM
I would like to suggest that public extension functions of the same class are also exempted from making the file generic
Dico
08/28/2019, 8:14 AM
Same issue as @karelpeeters, its discouraging
a
arekolek
08/28/2019, 9:22 AM
@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?