[pigeon] fixed cast error that can happen with FlutterApi and primitive lists#506
Conversation
20c1f90 to
e23b509
Compare
e23b509 to
f1debe4
Compare
stuartmorgan-g
left a comment
There was a problem hiding this comment.
LGTM modulo the question about the binary messenger.
| } | ||
| indent.write('static void setup(${api.name}$nullTag api) '); | ||
| indent.write( | ||
| 'static void setup(${api.name}$nullTag api, {BinaryMessenger$nullTag binaryMessenger}) '); |
There was a problem hiding this comment.
Off-topic, but the change here reminded me that I wanted to raise this: could we fix the fact that this name is wrong (it should be a verb, setUp) in all of the generators? If we don't want a breaking change we could have setup as a deprecated passthrough that calls setUp.
There was a problem hiding this comment.
Yea that sounds reasonable, we have talked about this in the past. I filed an issue for it: flutter/flutter#93062
| } | ||
| indent.write('static void setup(${api.name}$nullTag api) '); | ||
| indent.write( | ||
| 'static void setup(${api.name}$nullTag api, {BinaryMessenger$nullTag binaryMessenger}) '); |
There was a problem hiding this comment.
Is the addition of binaryMessenger related to this fix?
There was a problem hiding this comment.
It was required for the test for the fix. I think we were relying on compilation / text-output unit tests for FlutterApi generation a lot and didn't have existing runtime tests for the Dart code generated from FlutterApi. Less people use FlutterApi too so it probably went unnoticed because of that.
fixes: flutter/flutter#93012
Pre-launch Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy.CHANGELOG.mdto add a description of the change.///).If you need help, consider asking for advice on the
#hackers-newchannel on Discord.