Hello! I have such code (Kotlin jvm): ```fun main(...
# compiler
p
Hello! I have such code (Kotlin jvm):
Copy code
fun main() { 
      embeddedServer(Netty, port = 8080, host = "127.0.0.1") {
        routing {
            get("/") {
                call.respondHtml {
                    head {
                        title("Hello from Ktor!")
                    }
                    body {
                        +"${hello()} from Ktor. Check me value: ${Sample().checkMe()}"
                        div {
                            id = "js-response"
                            +"Loading..."
                        }
                        script(src = "/static/test_js.js") {}
                    }
                }
            }
            static("/static") {
                resource("test_js.js")
            }
        }
    }.start(wait = true)
}
After compiling it with
useIR=false
it works ok, but after compiling it with
useIR=true
it throws execption on `call.respondHtml {`: java.lang.NoSuchMethodError: 'java.lang.Object io.ktor.html.RespondHtmlKt.respondHtml$default(io.ktor.application.ApplicationCall, io.ktor.http.HttpStatusCode, kotlin.jvm.functions.Function1, int, java.lang.Object, kotlin.coroutines.Continuation)' Please, advice me how can I make it work with
useIR=true
.
u
We've fixed a whole bunch of issues in coroutines support in the IR backend very recently, this is available in master, but not yet in any released version of Kotlin. Probably you can check by using the
1.4-SNAPSHOT
Kotlin version (not sure if it has those fixes already though)
p
Thank you so much for your reply!