fix(stdlib/E4): source-pin sx-defined objc-class IMP trampolines + finish non-transitive bare-TYPE gate

Final E4 piece: the IMP trampolines emitted for an sx-defined #objc_class
resolved their method-signature types (e.g. -> BOOL) at whatever lowering
site triggered emission, not the class's defining module — so under the
single-hop bare-TYPE gate a 2-flat-hop objc type (BOOL via uikit->objc)
leaked as 'not visible' when m3te's main triggered emission.

- ast.ForeignClassDecl gains source_file (stamped by resolveImports, like
  ProtocolDecl/StructTemplate); stampFnBodySource stamps the decl + each
  bodied method body.
- emitObjcDefinedClassImps pins current_source_file to fcd.source_file for
  the whole per-class emission (alloc/dealloc/method/property IMPs).
- Removes the BOOLLEAF debug probe.

Completes E4: bare-TYPE visibility is single-hop non-transitive across all
member kinds; every instantiation kind (generic struct/fn, pack fn, param
protocol, type fn, objc-block, objc-class IMP) is source-pinned to its
defining module. Full gate green; m3te ios-sim builds + launches (exit 0).
This commit is contained in:
agra
2026-06-08 11:22:05 +03:00
parent 33a6f5c650
commit 9d5143aee6
3 changed files with 32 additions and 3 deletions

View File

@@ -847,6 +847,11 @@ pub const ForeignClassDecl = struct {
/// True when the sx-side alias NAME was a backtick raw identifier — exempt
/// from the reserved-type-name decl check (issue 0089).
is_raw: bool = false,
/// Defining module path (stamped by `resolveImports`), so the IMP trampolines
/// emitted for an sx-defined class resolve their method-signature types in the
/// module that declares the class — not the (cross-module) lowering site that
/// happens to trigger emission (E4). Null for a synthesized/sourceless decl.
source_file: ?[]const u8 = null,
};
pub const JniEnvBlock = struct {