fix(apple): derive dispatch coverage from located decode facts

This commit is contained in:
morluto
2026-10-09 00:49:30 +08:00
parent 15f92f2988
commit 488f448ae2
12 changed files with 601 additions and 116 deletions
+10 -3
View File
@@ -1,6 +1,7 @@
import type { z } from "zod";
import type { objcPropertySchema } from "../domain/native/objcSwiftMetadata.js";
import { issue, type DecodeIssue } from "./AppleDispatchDecodeFacts.js";
type ObjcProperty = z.infer<typeof objcPropertySchema>;
@@ -89,14 +90,20 @@ export const readObjcPropertiesOf = (
context: {
readonly owner: string;
readonly admit: () => boolean;
readonly failures: string[];
readonly issues: DecodeIssue[];
readonly location?: string;
},
): ObjcProperty[] => {
try {
return readObjcPropertyList(read, list, context.admit);
} catch (cause: unknown) {
context.failures.push(
`Properties of ${context.owner}: ${cause instanceof Error ? cause.message : String(cause)}`,
context.issues.push(
issue(
"objc_properties_categories",
"property_decode_failed",
`${context.owner}: ${cause instanceof Error ? cause.message : String(cause)}`,
context.location,
),
);
return [];
}