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] In TypeMetadata handle ExistentialContainers #2875

Open
stephen-hawley opened this issue Dec 12, 2024 · 0 comments
Open

[SwiftBindings] In TypeMetadata handle ExistentialContainers #2875

stephen-hawley opened this issue Dec 12, 2024 · 0 comments
Labels
area-SwiftBindings Swift bindings for .NET

Comments

@stephen-hawley
Copy link

In TypeMetadata.cs in TryGetTypeMetadataUncached

if (IsExistentialContainer(type)) {
    return TryGetExistentialContainerMetadata(type, out result);
}

// ...

static bool IsExistentialContainer(Type type)
{
}

static bool TryGetExistentialContainerMetadata(Type type, [NotNullWhen(true)] out TypeMetadata? result)
{
}

Note: depending on how we end up implementation ExistentialContainer, this might not be necessary. On the one hand, if every ExistentialContainer implements ISwiftObject then this won't be necessary. On the other hand if the type metadata is unique based on the contents of the existential container, then implementing ISwiftObject won't necessarily help or will create cache issues (ie, existential containers may not be allowed in the cache).

@stephen-hawley stephen-hawley added the area-SwiftBindings Swift bindings for .NET label Dec 12, 2024
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