https://kotlinlang.org logo
#announcements
Title
# announcements
p

poohbar

10/16/2019, 9:57 PM
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

jw

10/16/2019, 11:35 PM
Not a bug. That's how the JVM works. First one on the classpath wins.
g

groostav

10/17/2019, 4:11 AM
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
3 Views