Skip to content

[ObjC] Use NamedTypeReference to refer to id / SEL / BOOL #7077

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

bdash
Copy link
Contributor

@bdash bdash commented Jul 11, 2025

Rather than introducing duplicate definitions of these types, use a NamedTypeReference that will be resolved to the type from the libobjc type library when it is loaded.

This prevents these types from showing up as id_1 / SEL_1 in some places rather than as their expected names.

Fixes #7061.


I tried about 5 different ways of referencing a type by name and this is the only one that seemed to work correctly:

NamedTypeReferenceBuilder builder;
builder.SetName(QualifiedName(name));
return Type::NamedType(builder.Finalize());

I'm not really clear why that works but Type::NamedType(m_data, name) doesn't.

Rather than introducing duplicate definitions of these types, use a
NamedTypeReference that will be resolved to the type from the libobjc
type library when it is loaded.

This prevents these types from showing up as id_1 / SEL_1 in some places
rather than as their expected names.
bdash added a commit that referenced this pull request Jul 11, 2025
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.

[ObjC] Some parameters and return types use id_1 / SEL_1 rather than id / SEL
1 participant