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).
21 lines
652 B
Plaintext
21 lines
652 B
Plaintext
// Phase 2 step 2.6 (PLAN-FFI.md): xfail then green for the
|
|
// `#jni_method_descriptor("(Sig)Ret")` per-method JNI-descriptor
|
|
// override.
|
|
//
|
|
// The default descriptor is derived from sx types (Phase 2.8); this
|
|
// directive is the escape hatch when the auto-derived signature
|
|
// doesn't match (e.g., synthetic methods, ambiguous overloads,
|
|
// accessing JNI internals). It appears trailing the method's return
|
|
// type, before the terminating `;`.
|
|
|
|
#import "modules/std.sx";
|
|
|
|
Foo :: #jni_class("com/example/Foo") extern {
|
|
weirdMethod :: (self: *Self) -> i32 #jni_method_descriptor("()I");
|
|
}
|
|
|
|
main :: () -> i32 {
|
|
print("parse-only ok\n");
|
|
0
|
|
}
|