Repository navigation
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
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_1004833297
branch
4 times, most recently
from
November 4, 2026 04:00
b5010d2 to
974b36a
Compare
…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
Bot
force-pushed
the
test_1004833297
branch
from
November 4, 2026 04:19
974b36a to
972b580
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective-C classes that directly conform to a Java interface transpiled to an
@protocolpreviously 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.