Closed Schahen closed 2 years ago
Consider following code:
interface A {} declare interface AConstructor { new(): A; ping(); } declare var Z: AConstructor; declare class B extends Z {}
It will be translated to:
external interface A external interface AConstructor { fun ping() } external var Z: AConstructor external open class B : Z
Which won't compile, failing with error:
z.module_tmp.kt:25:25: error: unresolved reference: Z external open class B : Z
This is actually because we don't support extending expressions, as they are described in https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-6.html#extending-expressions
Actually, in the link above nothing is said about variables, but de-facto they are supported as well,
Before fixing https://github.com/Kotlin/dukat/issues/387 we are supposed to do something with this.
The most obvious thing to do is to just substitute Z with AConstructor wherever we encounter it.
It looks like we expect to have:
external interface A { companion object { fun ping(); } } external var Z: A; external open class B : A { constructor() }
Fixed in #460
Consider following code:
It will be translated to:
Which won't compile, failing with error:
This is actually because we don't support extending expressions, as they are described in https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-6.html#extending-expressions
Actually, in the link above nothing is said about variables, but de-facto they are supported as well,
Before fixing https://github.com/Kotlin/dukat/issues/387 we are supposed to do something with this.
The most obvious thing to do is to just substitute Z with AConstructor wherever we encounter it.