test(ir): lock pure Obj-C decision helpers before A6.1 extraction (A6.1 scaffolding step 1)

Test-first scaffolding for the Obj-C FFI domain (Phase A6.1) before the pure
helpers move into src/ir/ffi_objc.zig. Visibility-only change to the targets —
no behavior change.

- 3 new lower.test.zig tests for the pure helpers the ARCH-SAFETY A6.1 row names
  that lacked direct unit coverage:
  - deriveObjcSelector: niladic (bare name) / single-keyword (name:) /
    multi-keyword (_ -> : + trailing) / #selector(...) override (verbatim,
    keyword_count = #colons).
  - objcPropertyKind: assign default (primitive), strong default (object ptr),
    explicit weak/copy/assign win over the default.
  - isObjcClassPointer: pointer-to-foreign-Obj-C-class true; plain-struct ptr /
    *void / builtin false.
- objcTypeEncodingFromSignature (x6) + objcDefinedStateStructType (x3) already
  covered — no new tests.
- Widened deriveObjcSelector + objcPropertyKind to pub (they become facade
  methods in step 2; the ObjcPropertyKind enum stays private — tests compare via
  enum-literal == .strong). No logic touched.
- Recorded the A6.1 coverage inventory + residual gaps (resolveObjcParentName,
  class-method metadata, property/state lookups — example-guarded) in
  ARCH-SAFETY.md.

Gate: zig build, zig build test, bash tests/run_examples.sh -> 361/0
(no .ir churn; Obj-C snapshots 1309/1329/1332/1347 green).
This commit is contained in:
agra
2026-06-03 07:15:56 +03:00
parent d346bbb677
commit 0012228796
2 changed files with 117 additions and 2 deletions

View File

@@ -6031,7 +6031,7 @@ pub const Lowering = struct {
/// - arity ≥ 1: split the sx name on `_`; each piece becomes a
/// keyword with a trailing `:` (`addObject` → `addObject:`,
/// `combine_and` → `combine:and:`).
fn deriveObjcSelector(self: *Lowering, method: ast.ForeignMethodDecl, arity: usize) struct { sel: []const u8, keyword_count: usize, is_override: bool } {
pub fn deriveObjcSelector(self: *Lowering, method: ast.ForeignMethodDecl, arity: usize) struct { sel: []const u8, keyword_count: usize, is_override: bool } {
if (method.selector_override) |sel| {
var colons: usize = 0;
for (sel) |ch| {
@@ -15790,7 +15790,7 @@ pub const Lowering = struct {
/// - `weak` on a non-object field type → diagnostic
/// - `strong` (explicit or defaulted) on `*void` (ambiguous: Obj-C
/// object vs raw memory) → require explicit modifier
fn objcPropertyKind(self: *Lowering, field: ast.ForeignFieldDecl) ObjcPropertyKind {
pub fn objcPropertyKind(self: *Lowering, field: ast.ForeignFieldDecl) ObjcPropertyKind {
// Survey the modifier list.
var has_strong = false;
var has_weak = false;