I'm messing around with Dukat, it seems that MDC w...
# javascript
h
I'm messing around with Dukat, it seems that MDC won't compile. It generates the following code (I paired the source TS with the resulting Kotlin) =======
export 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:
Copy code
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!