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

fix ireference usage in structs #131

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Conversation

stevenbrix
Copy link
Collaborator

when someone tries to include a struct with reference types, the code gen breaks for a few reasons:

  1. in the constructor of the projected struct, we were using IReference<T> instead of T?
  2. in the abi conversion code, we weren't converting between the ABI and swift types appropriately

Changes

  • for (1) above, use the write_type api
  • for (2) above, check if the member type is an ireference and appropriately set the value

Tests

added test cases

Fixes WIN-450

@stevenbrix stevenbrix requested a review from a team as a code owner December 21, 2023 01:13
Copy link

@darinf darinf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you!

@stevenbrix stevenbrix merged commit a64f019 into main Dec 21, 2023
1 check passed
@stevenbrix stevenbrix deleted the steve/fix-ireference-in-struct branch December 21, 2023 04:18
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

Successfully merging this pull request may close these issues.

2 participants