Files
sx/examples/1414-ffi-jni-class-04-extends.sx
agra 2888f6fc00 refactor(ffi-linkage): Phase 7.3 — migrate 14xx ffi-jni examples #foreign→extern
13 JNI examples migrated (1410-1419/1423/1424/1425): import runtime classes
'#foreign #jni_class("X") {' → '#jni_class("X") extern {'. 1417 (all-runtimes)
also exercises #jni_interface/#objc_class/#objc_protocol/#swift_class/#swift_struct/
#swift_protocol — all take the postfix modifier (verified by probe), migrated via a
generalized '#foreign #<directive>("X") {' → '… extern {' rewrite. No 14xx snapshot
asserts on 'foreign'; empty snapshot diff, corpus-validated.

KEPT comment-only #foreign in 1426 (jni-extern-class test, no decls). Suite green
(647 corpus / 444 unit, 0 failed).
2026-06-15 07:00:32 +03:00

26 lines
863 B
Plaintext

// Phase 2 step 2.4 (PLAN-FFI.md): xfail then green for the `#extends`
// and `#implements` body items inside a `#jni_class` declaration.
//
// `#extends Alias;` declares a single-inheritance superclass reference
// using the sx-side alias name (not the foreign Java path — that lives
// in the alias's own `#jni_class(...)` directive arg). `#implements
// Alias;` is repeatable and records interface conformance.
//
// Step 2.4 introduces `hash_extends` and `hash_implements` tokens and
// refactors `JniClassDecl.methods` into a `members` tagged union that
// holds method/extends/implements variants.
#import "modules/std.sx";
View :: #jni_class("android/view/View") extern { }
Window :: #jni_class("android/view/Window") extern {
#extends View;
getDecorView :: (self: *Self) -> *View;
}
main :: () -> i32 {
print("parse-only ok\n");
0
}