dukat icon indicating copy to clipboard operation
dukat copied to clipboard

Wrong name for external module augmentation

Open Schahen opened this issue 5 years ago • 0 comments

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

Schahen avatar Sep 16 '20 11:09 Schahen