-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constructor inheritance #248
Comments
Hi! I'm not sure, let's discuss. So, let's modifiy slightly the example and consider this snippet of code: declare class A {
constructor(p1: string)
}
declare class B extends A { } This is translated to (I'm omitting imports and annotations): external open class A(p1: String)
external open class B : A Which is perfectly valid in that sense that it will compile. function main() {
let a = new A("HEY! I AM A");
let b = new B("HI! I AM B");
} while in Kotlin this won't compile: fun main() {
val a = A("HEY! I AM A")
val b = B("HI! I AM B")
} So this do feels like a problem to me. Let me think about it for a while and double-check typescript specs. If it is indeed a problem, it's definitely a major one - currently we check compilation errors but runtime errors will fly under our radars. |
Sorry for the late reply. The defintion file I wanted to use is https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/google.visualization/index.d.ts There's a lot of inheritance going on, specifically the charts don't explicity define constructors but inherit them. |
Will be released in 0.5.8 now can be checked with dukat@next |
I am running dukat version 0.0.28.
produces
Is this correct? I think the class
B
should also have the constructor fromA
.I just tried to start with Kotlin JS and use a JS library in Kotlin, but noticed that the type hints were wrong.
The text was updated successfully, but these errors were encountered: