-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[pigeon] Fix Object arguments in Swift and C++ #3020
[pigeon] Fix Object arguments in Swift and C++ #3020
Conversation
(I haven't run all of the new integration tests locally yet, so something may well fail due to a typo in a host implementation or something.) |
@stuartmorgan seems like you did break a couple tests |
I think it'll all pass now. Kotlin was just a copypasta mistake, but C++ I was missing part of the fix since I forgot that (I'm pretty sure that |
expect( | ||
code, | ||
contains( | ||
'const auto* a_generic_object_arg = &encodable_a_generic_object_arg;')); |
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.
These new unit tests aren't strictly necessary, since it was already failing compilation, but since we have this suite of extraction format tests already I thought it would be useful to include them to have fast-test coverage of this special case.
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.
lgtm
Landing on red to green the tree; I'm not sure what's going on since all the individual tests show green, but the overall status still shows red. |
Fixes a warning in generated Swift output when an argument is of type
Object
. This is blocking flutter/plugins#6914 since we check our macOS and iOS plugin code for warnings in CI.Rather than add a Dart generator unit test for this one specific case, I tightened the Swift compilation settings for our test plugin to treat warnings as errors (per flutter/flutter#59116 (comment)) to catch the entire class of errors, and added
echo*
variants for Object to make sure this one then showed up.Incidental fixes:
Object?
, which we'd never noticed because we weren't analyzing any generated code that returningObject
orObject?
before.Object
in the C++ generator, causing it to throw. I'm not sure this is the output I'll keep for C++ (thus the TODO), but it's the simple fix to make it work at all.Fixes flutter/flutter#117994
Part of flutter/flutter#59116
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.