Hackintoshfive
09/27/2020, 5:43 PMexport class MDCFoundation<AdapterType extends {} = {}> {
external open class MDCFoundation<AdapterType : Any>(adapter: AdapterType = definedExternally) {
=======
export class MDCComponent<FoundationType extends MDCFoundation> {
external open class MDCComponent<FoundationType : MDCFoundation__0>(root: Element, foundation: FoundationType = definedExternally, vararg args: Any) {
=======
static attachTo(root: Element): MDCComponent<MDCFoundation<{}>> {
return new MDCComponent(root, new MDCFoundation({}));
}
companion object {
fun attachTo(root: Element): MDCComponent<MDCFoundation<Any>>
}
=======
To reproduce, just:
implementation(npm("@material/button", "7.0.0", generateExternals = true))
and try to compile - it will fail because, in the last snippet, the return type is MDCComponent<MDCFoundation<Any>>, however, MDCComponent only accepts MDCFoundation__0, which is not a supertype (although it is defined).
I don't write TS or JS, so I can't really debug any more than this. I appreciate any effort expended on my corner case!