From 8c12572c897e1c6e25cb94f8e93fbed1c6fd074c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 6 Aug 2026 19:22:55 +0200 Subject: [PATCH] [registrar] Import the framework for NSObject types used in method signatures. 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 ' is always emitted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ddb2f938-9d62-4ccf-8ce8-70056d74178b --- tools/common/StaticRegistrar.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/common/StaticRegistrar.cs b/tools/common/StaticRegistrar.cs index 7d25573bb23c..8105e06a5581 100644 --- a/tools/common/StaticRegistrar.cs +++ b/tools/common/StaticRegistrar.cs @@ -2479,6 +2479,8 @@ string ToObjCParameterType (TypeReference type, string descriptiveMethodName, Li if (!IsPlatformType (td)) return "id"; + CheckNamespace (td, exceptions); + if (HasProtocolAttribute (td)) { return "id<" + GetExportedTypeName (td) + ">"; } else {