refactor(ffi-linkage): Phase 9.2b — rename runtime-class fns + state → runtime_* / is_reference
The runtime-class object-model identifiers (Decision 5): parse/lower/find/resolve/ register/stamp fns Foreign→Runtime (parseRuntimeClassDecl, lowerRuntimeMethodCall, findRuntimeMethodInChain, resolveRuntimeMethodReturnType, registerRuntimeClassDecl, runtimeClassStructType, runtimeKindForOffset, …); state foreign_class_map→ runtime_class_map, current_foreign_class/_method→current_runtime_*, the foreign_class_decl union variant→runtime_class_decl, foreign_method/static/instance/ class→runtime_*; and the reference-vs-define flag is_foreign→is_reference (+ is_foreign_eff→is_reference_eff) now that it only lives on RuntimeClassDecl. Snapshot-neutral; suite green (646/444). Remaining 9.2: the foreign_path family (coupled .sx hooks: jni_main_foreign_path_at spans build.sx/bundle.sx/compiler_hooks.zig/specs.md) + the extern-ref validators (checkForeignRefs etc. → Extern, linkage not runtime) + bare 'foreign' comments.
This commit is contained in:
@@ -67,17 +67,17 @@ test "ProgramIndex declaration maps round-trip (A1.1b)" {
|
||||
try idx.module_const_map.put("AF_INET", .{ .value = &blk, .ty = .i32 });
|
||||
try std.testing.expect(idx.module_const_map.get("AF_INET").?.value == &blk);
|
||||
|
||||
// foreign_class_map: sx alias → RuntimeClassDecl.
|
||||
// runtime_class_map: sx alias → RuntimeClassDecl.
|
||||
const fcd = ast.RuntimeClassDecl{
|
||||
.name = "NSString",
|
||||
.foreign_path = "NSString",
|
||||
.runtime = .objc_class,
|
||||
.members = &.{},
|
||||
.is_foreign = true,
|
||||
.is_reference = true,
|
||||
.is_main = false,
|
||||
};
|
||||
try idx.foreign_class_map.put("NSString", &fcd);
|
||||
try std.testing.expect(idx.foreign_class_map.get("NSString").? == &fcd);
|
||||
try idx.runtime_class_map.put("NSString", &fcd);
|
||||
try std.testing.expect(idx.runtime_class_map.get("NSString").? == &fcd);
|
||||
|
||||
// protocol_decl_map: protocol name → ProtocolDeclInfo.
|
||||
try idx.protocol_decl_map.put("Show", .{ .name = "Show", .is_inline = false, .methods = &.{} });
|
||||
|
||||
Reference in New Issue
Block a user