Skip to content
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

[FEATURE REQUEST] ability to add structs as fields of structs #5414

Closed
Areopagitics opened this issue Jun 15, 2024 · 2 comments
Closed

[FEATURE REQUEST] ability to add structs as fields of structs #5414

Areopagitics opened this issue Jun 15, 2024 · 2 comments

Comments

@Areopagitics
Copy link

Would it be possible to do something like this?
Thank you! Keep up the good work!

export struct File {
    name: string,
    parent_folder: Folder,
    file_path: string,
    checked: bool,
    file_id: int,
}

export struct Folder {
    name: string,
    file_children: [File],
    folder_path: string,
    checked: bool,
}
@kanashimia
Copy link

This is basically two feature requests:

  1. Allow to use structures before they are defined.
  2. Add recursive data structures.

Second one is a duplicate of #4218
You can work around this by storing indices to an array instead, like you do in rust.

@ogoffart
Copy link
Member

Thanks for filling an issue and thanks @kanashimia for already replying.
I'm going to close this as a duplicate of #4218

@ogoffart ogoffart closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants