The UIKitPlatform struct had a string of '*void = null; // UIWindow*' fields — the type lived in a comment, every callsite had to 'xx'-cast back to the real type. Migrated to the real foreign-class pointer types now that M3 declared all the relevant '#objc_class' aliases: window: ?*UIWindow root_vc: ?*UIViewController gl_view: ?*UIView (SxGLView OR SxMetalView — both extend UIView) gl_layer: ?*CALayer (CAEAGLLayer OR CAMetalLayer) gl_ctx: ?*EAGLContext display_link: ?*CADisplayLink Each field is wrapped in '?' since the platform may not have set it yet (gl_ctx is null in metal mode, display_link is null before the first frame, etc.). SxSceneDelegate's window getter/setter now take/return '?*UIWindow' instead of '*void' so calling code doesn't need an xx-cast. Required fix in objcTypeEncodingFromSignature: '?T' (optional) was bailing with 'type kind not yet supported'. Apple's runtime treats nullability as 'pointer may be null' — the wire encoding is the same as T. Recursive unwrap handles ?*UIView → '@', ?*CADisplayLink → '@', etc. Chess on iOS-sim: board renders, full pipeline intact. 183 tests + zig build test green.
36 KiB
36 KiB