Skip to content

Conversation

kotlarmilos
Copy link
Member

Description

This PR introduces SwiftSelf<T> and SwiftIndirectResult structs to facilitate interop with Swift structs. Runtime support along with the corresponding test cases (#102079 and #102082) will be added in subsequent PRs.

The idea is to keep both SwiftSelf and SwiftSelf<T> for now, as SwiftSelf will be utilized for class support and closure context.

Fixes #100543

@ghost
Copy link

ghost commented May 27, 2024

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

…pServices/Swift/SwiftTypes.cs

Co-authored-by: Matous Kozak <[email protected]>
kotlarmilos and others added 2 commits May 29, 2024 09:15
…pServices/Swift/SwiftTypes.cs

Co-authored-by: Aaron Robinson <[email protected]>
…pServices/Swift/SwiftTypes.cs

Co-authored-by: Aaron Robinson <[email protected]>
}
public readonly partial struct SwiftSelf<T> where T: unmanaged
{
private readonly int _dummyPrimitive;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
private readonly int _dummyPrimitive;
private readonly T _dummyPrimitive;

Using T here allows the C# compiler to detect infinite generic expansion at build time.

@kotlarmilos kotlarmilos merged commit ab604e9 into dotnet:main Jun 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce SwiftSelf<T> and SwiftIndirectResult to represent Swift structs and enums in C#
5 participants