Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
557 stars 42 forks source link

Generated Kotlin code for language-server doesn't compile #516

Open PascalHonegger opened 1 year ago

PascalHonegger commented 1 year ago

🕗 Version

0.5.8-rc.4

💻 Code or Package Name

vscode-languageserver@8.1.0

🙁 Actual behavior

Many compile errors within generated Kotlin code from TypeScript delcaration, here are some example code snippets which were generated:

@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") // ERROR: This annotation is not repeatable
external interface RAL {
    var applicationJson: `T$3`
    var messageBuffer: `T$4`
    var console: `T$5`
    var timer: `T$6`

    companion object {
        fun install(ral: RAL)
    }
}
import `_` // ERROR: Names _, __, ___, ..., are reserved in Kotlin
external open class CancellationTokenSource : AbstractCancellationTokenSource {
    open var _token: Any // ERROR: should be "token: CancellationToken" like in the interface
    override fun cancel()
    override fun dispose()
}
package TraceFormat // ERROR: Redeclaration: TraceFormat

🙂 Expected behavior

Generated Kotlin types compile