You are currently viewing I am a total Kotlin / JetBrains IDEA noob. Why is it that when I run a .kts file, I get 100 error messages unrelated to the main() function?

I am a total Kotlin / JetBrains IDEA noob. Why is it that when I run a .kts file, I get 100 error messages unrelated to the main() function?

Edit1:

There are obviously other functions besides main() in the file, but it seems like the compiler is executing these even though they are not called?

Here is what I am trying to run:

fun main() { println(“Hello world!”) }

Edit2:

If I comment out the rest of my code, it does not appear that I get an error, although I am not sure why there appears to be no printing?

submitted by /u/user019244
[link] [comments]