Kotlin / dukat

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

Type parameters are not substituted in constructor of child classes #414

Closed joffrey-bion closed 3 years ago

joffrey-bion commented 4 years ago

Using 0.5.8-rc.0, I found this generics-related issue, which is similar to https://github.com/Kotlin/dukat/issues/349, but has not been fixed as part of it.

Source:

export declare abstract class Parent<T> {
  constructor(arg?: T);
}
export declare class Child extends Parent<number> {
}

Generated:

external open class Parent<T>(arg: T = definedExternally)

external open class Child(arg: T = definedExternally) : Parent<Number>

The type parameter T in the constructor of the child should have been replaced by Number, and instead gives a compile error.

JSMonk commented 3 years ago

Fixed in https://github.com/Kotlin/dukat/pull/451