jextract/ffm: Fix TranslatedParameter to hold a single JavaParameter#759
Merged
Conversation
ktoso
approved these changes
May 19, 2026
ktoso
reviewed
May 19, 2026
| * } | ||
| */ | ||
| public static void receiveDataProtocol(Data dat, Optional<Data> dat2) { | ||
| public static void receiveDataProtocol(Data dat, java.util.Optional<Data> dat2) { |
Collaborator
There was a problem hiding this comment.
nice side effect, FQN are better
ktoso
reviewed
May 19, 2026
| /// Array because one Swift parameter can be mapped to multiple parameters. | ||
| var javaParameters: [JavaParameter] | ||
| /// Java parameter mapped to the Swift parameter. | ||
| var parameter: JavaParameter |
Collaborator
There was a problem hiding this comment.
👍 Yeah I think that's right, lowering would explode it into multiple if necessary
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.
This is a minor refactoring to fix the property type of
javaParametersin the FFM-sideTranslatedParameter.Currently, it is defined as an array. However, I believe this is incorrect.
This type represents the Java function interface that the user interacts with, meaning it is not yet "lowered". Therefore, the parameter count should always match the number of Swift arguments.
In practice, there wasn't a place in the codebase where multiple parameters were actually being used.
This PR changes the property to hold a single
JavaParameter.This aligns the implementation with the JNI side.