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

Merged
merged 1 commit into from
Jul 13, 2025
Merged

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.

@bdash bdash force-pushed the objc-ntr branch 2 times, most recently from a8093fc to b226f2a Compare July 11, 2025 21:02
bdash added a commit that referenced this pull request 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.
@bdash bdash merged commit 0fa2249 into dev Jul 13, 2025
1 check passed
@bdash bdash deleted the objc-ntr branch July 13, 2025 17:34
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