Skip to content

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

Merged
bdash merged 1 commit into
devfrom
objc-ntr
Jul 13, 2025
Merged

[ObjC] Use NamedTypeReference to refer to id / SEL / BOOL#7077
bdash merged 1 commit into
devfrom
objc-ntr

Conversation

@bdash
Copy link
Copy Markdown
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
@emesare emesare added this to the Helion milestone Jul 23, 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

2 participants