-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that conversions are defined for lambdas defined in struct #1605
Ensure that conversions are defined for lambdas defined in struct #1605
Conversation
A few notes for reviewers can be found below.
|
struct StructWithLambda { | ||
lambda LambdaCallback = (String?) -> String? | ||
|
||
static fun invoke_callback(callback: LambdaCallback?): String? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it necessary to make lambda (and its parameters) optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not check it before pushing the change. I used the received reproducer.
It has just been checked and it seems, that even without any optional parameters the problem reproduces.
E.g.:
lambda InnerLambda = () -> Void
static fun invoke_callback(callback: InnerLambda)
d4f4b31
to
90c5060
Compare
In the case of Swift language, when lambda was defined in a structure, then the code could not compile because of missing conversion functions. Interestingly, that was not the case for classes. After investigation it turned out, that the root cause is related to missing inclusion of SwiftLambdaConversion template in SwiftStructConversion. This change: - adds missing inclusion of lambda conversions in the mentioned template (SwiftStructConversion.mustache) - implements functional tests for Swift to check that the fix works as expected - implements functional tests for Dart and Android to also cover the tested case in these technologies - updates the reference files for smoke tests related to definition of nested fields in structs Signed-off-by: Patryk Wrobel <[email protected]>
90c5060
to
a615096
Compare
No functional changes since last patch-set -- only |
In the case of Swift language, when lambda was defined in a structure, then the code could not compile because of missing conversion functions. Interestingly, that was not the case for classes.
After investigation it turned out, that the root cause is related to missing inclusion of SwiftLambdaConversion template in SwiftStructConversion.
This change: