Limit of one fun main(arg : Array<String>) per package namespace


#1

Is there a way to have a runnable fun declared in separate files within the sname package namespace?

If I create two files with fun main(…){} I get an error for each main()
Kotlin: kotlinExamples is already defined in ‘internal fun main(args : jet.Array<jet.String>) : Unit defined in kotlinExamples’

Thanks

eric


#2

You can't have two mains in the same package. But you can have as many packages as you like in the same directory, so simply changing the name of the package in one of your files should fix the problem.


#3

Thanks

Interesting that packages are not tied to folders. thanks for the reply.