Kotlin / dukat

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

Mixed ordinary get/set and native get/set result in conflicting overloads #370

Open trilis opened 4 years ago

trilis commented 4 years ago
interface NodeExtensions {
    '.js': (m: NodeModule, filename: string) => any;
    '.json': (m: NodeModule, filename: string) => any;
    '.node': (m: NodeModule, filename: string) => any;
    [ext: string]: (m: NodeModule, filename: string) => any;
}

will generate this code:

external interface NodeExtensions {
    operator fun get(key: String): (m: NodeModule, filename: String) -> Any
    operator fun set(key: String, value: (m: NodeModule, filename: String) -> Any)
    @nativeGetter
    operator fun get(ext: String): ((m: NodeModule, filename: String) -> Any)?
    @nativeSetter
    operator fun set(ext: String, value: (m: NodeModule, filename: String) -> Any)
}

Which then fails with CONFLICTING_OVERLOADS.

Schahen commented 4 years ago

checked and there's still a problem (though nativeGetters and setters are set correctly) so 0.5.9 let it be.