Kotlin / dukat

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

Missing override for properties inherited from multiple interfaces (for non-direct ancestors) #417

Open joffrey-bion opened 3 years ago

joffrey-bion commented 3 years ago

Source TS:

export interface GrandParent {
  common: string;
}
export interface Parent1 {
  common: string;
}
export interface Parent2 extends GrandParent {
  irrelevant: string;
}
export interface Child extends Parent1, Parent2 {
  childProp: string;
}

Generates:

interface GrandParent {
    var common: String
}
interface Parent1 {
    var common: String
}
interface Parent2 : GrandParent {
    var irrelevant: String
}
interface Child : Parent1, Parent2 {
    var childProp: String
    // missing override here for property "common"
}

Which gives the compile error:

Class 'Child' must override public open var common: String? defined in Parent1 because it inherits multiple interface methods of it
ilgonmic commented 2 years ago

var common: String? but in both cases it is non-nullable String Now I checked that generated code is compiled