-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
TypeScript compatibility #305
Comments
Casting interface to object not support yet. Currently you can use export class xevent {
x: i32;
}
export function foo(e: xevent): xevent {
return e;
}
export function foo2(e: xevent): xevent {
return { x: 1 } as xevent;
} |
Where/when does the casting happen in this example? |
Regarding interfaces: While we have a custom GC now, it's not yet fully functional and lacks some properties that'd be necessary to properly support interfaces, like virtual lookup tables and runtime class ids on instances. While this can be done, I'd favor implementing higher level features on top of the proposed higher level specs once these land (no ETA on the GC spec yet), just because improving the custom GC is a lot of work and it's likely that it'll be thrown away again later anyway. |
Yes, for interfaces like that: interface IFoo {
boo(): i32;
} with methods this required vtable. But for interfaces which just declare objects without methods like interface IFoo {
x: i32;
s: string;
f: f64;
} Implementation could be much trivial. |
Does this affect |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
What's currently supported and what's not in terms of the TypeScript spec, see [1]?
It's understood that the dynamic features are not there. What about the rest?
Based on other issues, nested object initialization is not currently supported.
I also get issues with
interface
, see [2].[1] https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md
[2] a simple ts file
leads to
The text was updated successfully, but these errors were encountered: