From ee53348ce01e773528e8cdfffb17943f5ad9bd0b Mon Sep 17 00:00:00 2001 From: agra Date: Tue, 19 May 2026 19:39:56 +0300 Subject: [PATCH] ffi 1.28 follow-up: keyboard BOOL returns use #objc_call(bool) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apple documents `-becomeFirstResponder` and `-resignFirstResponder` as returning `BOOL`. The pre-`#objc_call` cast pattern in this file used `u8` because BOOL is ABI-equivalent to a 1-byte unsigned integer on both i386 (signed char) and arm64 (`bool`). The initial 1.28 migration carried that `u8` typing forward without question; switching to `bool` matches the documented API and aligns with the BOOL→bool mapping called out in PLAN-FFI.md Phase 3. First standalone exercise of `#objc_call(bool)`. The lowering is identical to `#objc_call(u8)` at the ABI layer (single byte in `w0` on AAPCS64), but the source-level type is now meaningful. --- library/modules/platform/uikit.sx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/modules/platform/uikit.sx b/library/modules/platform/uikit.sx index 4ceaffb..acc9f52 100644 --- a/library/modules/platform/uikit.sx +++ b/library/modules/platform/uikit.sx @@ -220,14 +220,14 @@ impl Platform for UIKitPlatform { show_keyboard :: (self: *UIKitPlatform) { inline if OS == .ios { if self.text_field == null { return; } - #objc_call(u8)(self.text_field, "becomeFirstResponder"); + #objc_call(bool)(self.text_field, "becomeFirstResponder"); } } hide_keyboard :: (self: *UIKitPlatform) { inline if OS == .ios { if self.text_field == null { return; } - #objc_call(u8)(self.text_field, "resignFirstResponder"); + #objc_call(bool)(self.text_field, "resignFirstResponder"); } }