`weirdMethod :: (self: *Self) -> s32 #desc("()I");` should parse,
today's 2.5 parser expects `;` immediately after the return type
and errors at the `#desc` token. The make-green follow-up adds a
`hash_desc` lexer token and threads an optional `desc_override`
field through `JniMethodDecl`.
21 lines
701 B
Plaintext
21 lines
701 B
Plaintext
// Phase 2 step 2.6 (PLAN-FFI.md): xfail then green for the
|
|
// `#desc("(Sig)Ret")` per-method JNI-descriptor override.
|
|
//
|
|
// The default descriptor is derived from sx types (Phase 2.8); `#desc`
|
|
// 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 `;`. Today the parser expects `;` immediately after
|
|
// the return type and errors at the `#desc` token.
|
|
|
|
#import "modules/std.sx";
|
|
|
|
Foo :: #jni_class("com/example/Foo") {
|
|
weirdMethod :: (self: *Self) -> s32 #desc("()I");
|
|
}
|
|
|
|
main :: () -> s32 {
|
|
print("parse-only ok\n");
|
|
0;
|
|
}
|