Hi, I’d like to know what the *`@JvmMultifileClass...
# general-advice
r
Hi, I’d like to know what the
@JvmMultifileClass
annotation is used for when applied at the file level and combined with
@JvmName
. As far as I can tell, it only generates an additional file and doesn’t provide any real benefit. If I use only
@JvmName
, it does exactly what I expect—changing the name of the class that holds all the top-level declarations in the file. If I have a declared class, it stays outside that synthetic file-class anyway. So what’s the purpose of the annotation? It means having multiple files with the same jvmName?
k
It allows you to define Kotlin functions in separate files, but only one class file gets generated for them.
r
Okay, so if I only want one file, changing the class name and applying
JvmMultifileClass
would be unnecessary, thanks