Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
552 stars 44 forks source link

Wrong name for external module augmentation #408

Open Schahen opened 3 years ago

Schahen commented 3 years ago

Following code:

// _core.d.ts
export interface Something {}

// decl.d.ts
import "./_core";

declare module "./_core" {
  interface Static {
    getVersion(): string;
  }
}

The will be compiled to:

@file:JsModule("./_core")
@file:JsNonModule
@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
package `.._core`

external interface Static {
    fun getVersion(): String
}

Apart from problematic package name, the problem here is the name of the file generated, which in this particular case would be something like (depending on module resolution) decl..._core.module_resolved_name.kt