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

[SwiftBindings] Revert emitting Swift projection on error #2890

Open
Tracked by #2822
jkurdek opened this issue Dec 17, 2024 · 1 comment
Open
Tracked by #2822

[SwiftBindings] Revert emitting Swift projection on error #2890

jkurdek opened this issue Dec 17, 2024 · 1 comment
Labels
area-SwiftBindings Swift bindings for .NET

Comments

@jkurdek
Copy link
Member

jkurdek commented Dec 17, 2024

When generating projections we might encounter multiple scenarios in which we are not able to generate a correct projection. This can stem from a bug or scope limitation of supported scenarios. If we cannot generate correct code for the projection we should revert projecting all the related bits.

@jkurdek jkurdek self-assigned this Dec 17, 2024
@jkurdek jkurdek added the area-SwiftBindings Swift bindings for .NET label Dec 17, 2024
@jkurdek jkurdek removed their assignment Dec 17, 2024
@jkurdek jkurdek changed the title Revert emitting Swift projection on error [SwiftBindings] Revert emitting Swift projection on error Dec 17, 2024
@jkurdek
Copy link
Member Author

jkurdek commented Dec 17, 2024

We could do this by creating something like "transactions" - when we're about to start projecting a method, we "start a transaction" which will reset all output buffers. Then we project/write and everything goes into output buffers, only when we're successfully done, we "commit" and appends the buffers to the actual output.
This would be more robust than trying to check for every error condition upfront - it's easy to miss something, and that doesn't count actual unexpected exceptions during the writing process (our bugs and so on). It would be really nice if the tool was resilient to its own bugs to some degree.

Originally posted by @vitek-karas in #2870 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-SwiftBindings Swift bindings for .NET
Projects
None yet
Development

No branches or pull requests

1 participant