Skip to content

Objective-C classes that directly conform to a Java interface transpiled to an @protocol previously had to implement the unadapted JVM method signature when the interface method was annotated with @ObjectiveCKmpMethod. If the Objective-C class only implemented the adapted Objective-C selector, calls from Java through the interface failed with an unrecognized selector error at runtime. - #2906

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1004833297
Nov 4, 2026

Conversation

@copybara-service

Copy link
Copy Markdown

Objective-C classes that directly conform to a Java interface transpiled to an @protocol previously had to implement the unadapted JVM method signature when the interface method was annotated with @ObjectiveCKmpMethod. If the Objective-C class only implemented the adapted Objective-C selector, calls from Java through the interface failed with an unrecognized selector error at runtime.

Generate a static C dispatch helper for interface methods that checks respondsToSelector: at runtime to dispatch directly when implemented while routing native Objective-C conforming instances through the adapted selector. Rewrite Java interface call sites, sub-interfaces, and inherited methods to route through this helper, marking unadapted protocol declarations optional.

@copybara-service
copybara-service Bot force-pushed the test_1004833297 branch 4 times, most recently from b5010d2 to 974b36a Compare November 4, 2026 04:00
…led to an `@protocol` previously had to implement the unadapted JVM method signature when the interface method was annotated with `@ObjectiveCKmpMethod`. If the Objective-C class only implemented the adapted Objective-C selector, calls from Java through the interface failed with an unrecognized selector error at runtime.

Generate a static C dispatch helper for interface methods that checks `respondsToSelector:` at runtime to dispatch directly when implemented while routing native Objective-C conforming instances through the adapted selector. Rewrite Java interface call sites, sub-interfaces, and inherited methods to route through this helper, marking unadapted protocol declarations optional.

PiperOrigin-RevId: 1013499402
@copybara-service
copybara-service Bot merged commit 972b580 into master Nov 4, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_1004833297 branch November 4, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant