Reputation: 99
I wrote a simple hello world in kotlin and it keeps giving me this error:
Main.kts:3:10: warning: parameter 'args' is never used fun main(args : Array) {
I'm at a loss for what could be the issue. I'm using the latest version of "Ultimate Intellij" and my guess is it must be some sort of issue with the ide. Below is all my code. I'm using the java 8 sdk, with kotlin 1.2
fun main(args : Array<String>) {
println("Hello, world!")
}
Upvotes: 1
Views: 479
Reputation: 1573
I think you have the following issues:
You created a Kotlin script (kts file) instead of a Kotlin class (kt file). The main method is not called in Kotlin scripts. You should make an explicit call to the main method or other available methods. (it's a scripting file like a bash script).
The warning is correct. The args argument is not used ;-)
Upvotes: 3