Skip to content

Issue when overriding an Interface #67

Closed
@FeernandoOFF

Description

@FeernandoOFF

Hello,First I'd like to thank your project it has been a life saver and the last piece that I needed to start my Kotlin-JS interop project so, thanks!

I'm experiencing an issue where I have an Interface that has a suspend function in it and an Implementation but it seems that the override goes to the exported JS, so Given the following code the compiler will throw the next exception:

'getDataAsync' overrides nothing.

Interface:

interface FooInterface {
    suspend fun getData(): String
}

Implementation:

@JsExport
class Foo(
    private val httpClient: HttpClient = HttpModule().client
): FooInterface  {
    @JsExport.Ignore
    @JsPromise
    override suspend fun getData(): String {
        val response = httpClient.get(CivRoutes()).bodyAsText()
        return response
    }
}

Is there a way that the generated JS just ignores the override?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions