-
Notifications
You must be signed in to change notification settings - Fork 205
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
[SwiftBindings] Implement algorithm deciding whether a struct should be projected as class or struct #2886
Comments
I did look into swift code - tried to find a better way to determine whether to project something as a struct or as class. There is a field on An alternative is to recursively traverse struct children - this however means that all of struct children have to processed before a projection involving a struct can be made - which means building up the type database of multiple modules before a single projection can be made. |
Having a complete type database seems more reliable to me. |
+1. We can assume that projection tooling will process modules in a correct order. We might not be able to read |
Great! I then propose the following design: Assumption: Tooling will process modules in correct order. Processing each module will result in a type database file. When processing a new module the tooling will first parse the ABI and build a graph of dependencies for each type. Dependencies will go into two categories (same module / other modules). Then in a post-processing step the tooling will process the graph and compute the necessary information. Doing this in correct order will ensure that when processing a node either its dependencies reside in one of the type databases for previous modules or have been processed earlier. After the processing is finished the tooling will lock the type database and save it. |
Struct should be projected as a struct if:
The text was updated successfully, but these errors were encountered: