I have two files named `Extensions.kt` in the same...
# announcements
p
I have two files named
Extensions.kt
in the same package but in two different modules. Maven compiles everything successfully but when running it it suddenly can't find some of the extension methods. Is that a bug?
j
Not a bug. That's how the JVM works. First one on the classpath wins.
g
You could use multiple filenames, or if you really want to keep the same filename, the annotation
@JvmName("Extensions1")
at the top of the file (I think technically on the
package
statement?) will let you have multiple
Extensions.kt
files, that produce
Extensions.class
and
Extensions1.class
binaries, solving your classpath issue