Closed RaphaelTarita closed 9 months ago
Currently, the example for "Translate Kotlin code to JavaScript code" sends the following Kotlin code to the compiler server:
fun main() { println(args[0]) }
This is invalid Kotlin code (atleast in 1.9.20) because args is an unresolved reference. The compiler server will return the following response:
args
{ "jsCode": null, "exception": null, "errors": { "File.kt": [ { "interval": { "start": { "line": 1, "ch": 12 }, "end": { "line": 1, "ch": 16 } }, "message": "Unresolved reference: args", "severity": "ERROR", "className": "ERROR" } ] }, "text": "" }
I fixed it by changing the sent Kotlin code to:
fun main(args: Array<String>) { println(args[0]) }
The updated example will work as expected with the compiler server.
Thanks! 🙏
Currently, the example for "Translate Kotlin code to JavaScript code" sends the following Kotlin code to the compiler server:
This is invalid Kotlin code (atleast in 1.9.20) because
args
is an unresolved reference. The compiler server will return the following response:I fixed it by changing the sent Kotlin code to:
The updated example will work as expected with the compiler server.