Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

fix issues marshaling booleans #823

Merged
merged 1 commit into from
Feb 13, 2024
Merged

fix issues marshaling booleans #823

merged 1 commit into from
Feb 13, 2024

Conversation

stephen-hawley
Copy link
Contributor

In dotnet land, bools aren't blittable and every [UnmanagedCallersOnly] method that took a bool was failing a runtime check because of the bool - which is weird - you would think that the compiler would catch that as it does with other types, but not in this case.

The fix is in two parts:

  1. redo the code that generates the signature of the C# receiver. This is just a case of macro changing the return type and argument types from bool to nint.
  2. redo the code that marshals from receivers to C# and return the code that marshals the C# return value to swift.

This fixes 10 tests.

@rolfbjarne
Copy link
Member

you would think that the compiler would catch that as it does with other types, but not in this case.

Yes, you would think... dotnet/roslyn#64086

@stephen-hawley stephen-hawley merged commit bb0327a into main Feb 13, 2024
@stephen-hawley stephen-hawley deleted the non-blittable branch February 13, 2024 20:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants