This is the error code
error: unresolved reference: string (myfirstfile.kts:1:22)
myfirstfile.kts:1:22: error: unresolved reference: string
fun main(args: Array<string>) {
^ww33
This is the error code
error: unresolved reference: string (myfirstfile.kts:1:22)
myfirstfile.kts:1:22: error: unresolved reference: string
fun main(args: Array<string>) {
^ww33
I'm guessing because it looks like you modified your code before pasting it here, because the error doesn't match what you're showing.
I'm guessing you had
fun main(args: Array<string>) {
and that doesn't work because there is no class named string
. It's named String
with a capital S. By convention, all class names start with capital letters. (It's possible to define a class name without an initial capital letter, but no one does this because it makes your code hard to read.) It should look like this:
fun main(args: Array<String>) {