Skip to content

Commit ed5bb66

Browse files
rolfbjarneCopilot
andauthored
[registrar] Import the framework for NSObject types used in method signatures. (#26418)
The static registrar could emit method signatures referencing an Objective-C type whose framework header wasn't imported in the generated code, which made the generated code fail to compile: registrar.h:266:27: error: expected a type 266 | -(void) registerWebView:(WKWebView *)p0; | ^ This happened for a wrapper type from a binding project (Google.MobileAds' GADMobileAds) with a method taking a WebKit.WKWebView parameter, where nothing else in the app pulled in the WebKit framework: 'CheckNamespace' is only called for the types the registrar iterates over, not for the types showing up in the generated method signatures. Fix this by calling 'CheckNamespace' in 'ToObjCParameterType' for platform NSObject types, so that the corresponding '#import <Framework/Framework.h>' is always emitted. Copilot-Session: ddb2f938-9d62-4ccf-8ce8-70056d74178b --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e4325ae commit ed5bb66

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tools/common/StaticRegistrar.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,6 +2479,8 @@ string ToObjCParameterType (TypeReference type, string descriptiveMethodName, Li
24792479
if (!IsPlatformType (td))
24802480
return "id";
24812481

2482+
CheckNamespace (td, exceptions);
2483+
24822484
if (HasProtocolAttribute (td)) {
24832485
return "id<" + GetExportedTypeName (td) + ">";
24842486
} else {

0 commit comments

Comments
 (0)