-
-
Notifications
You must be signed in to change notification settings - Fork 669
Support inline object types #338
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
Comments
Should be doable, but with caveats. For example, a type Question is, should it still be supported nonetheless? Currently, one has to use an explicit class to make it work, i.e. class MyType { x: i32 }
export function add(a: MyType): i32 {
return a.x;
} which feels a bit more natural given the limitations. |
I think it can work, the ordering issues can be abstracted away. If the overall shape of objects is known, regardless of order, then could the compiler just ensure the same order in the output? Or can the compiler just pass the dereferenced values individually to the function parameters ? |
Closing this issue as part of 2020 vacuum as it appears to be outdated and superseded by efforts to use a class type instead, and create instances from object literals. The new approach has several advantages in that no virtual lookups are involved. |
The text was updated successfully, but these errors were encountered: